rX rotations from KGC to SVG


Click to view larger image

KitCAD i3 KGC rX rotations from KGC to SVG (example). Image above displays on the left a KGC rotation of a BC2di Object Item, and on right is the SVG rotation (clearer lines). Some drawings may display differently after the change (such as w600 x h600, fix by changing width to 633 – other Object Items may not draw correctly)

Using the following code will cause position errors when drawing plan view Object Items and when generating 3D renderings. Use of code is for example only. SVG rotated Object Items will not align with 3d renderings (even after altering functions).

Edit _r5en.js and append to end of file, the following code block:

The KitCAD i3 KGC functions of testkp2r300 and testkp2r600 will require editing by an administrator to align SVG rotation with vrml/x3dom placements should it be required (this should cause errors with 3d renderings as SVG rotated Object Items center point of rotation may differ to the center point of KGC rotation). The Object Item Depth of 300 and 600 are provided by default, other depths could be added. The function of runkp2r is used to determine Object Item depth before calling the functions of testkp2r300 or testkp2r600 which set a list of values depending on depth. The function of runkp2r then runs a function of testkp2rX that is used to assign TOP and LEFT positions from the list of values only when matched with the WIDTH of an Object Item (from 2000mm to 50mm).


Click to view larger image

For KGC rotations; The best way to get the values for the function of testkp2r300; Is to place a row of WC2di Object Items (start with one 1000m width, 300mm depth which is placed on-top of a BC2di object item) onto plan view next to one another (largest 1000mm width to smallest 100mm) along the top of screen. Then a column of object items (largest 1000mm width to smallest 100mm) on the left most of screen, scrolling down to place Object Items (if required). Rendering the view should show a ‘L’ shaped view of Object Items (when 3d is spun 90deg) [See image above for an example L shape]. Remove any rendering position errors by altering the values within each function. Repeat this process using BC2di Object Items for testkp2r600 values.

Leave a Reply

You must be logged in to post a comment.