Mar 7, 2016
-
Jeff Gay
Beta of SVG Support AvailableFor all interested, SVG import and export has been added to the DEV branch.
There are a number of changes to enable the SVG support, including changes in CSG.js and format.js in order to support ellipses fully. A new library has been added, sax-js, which was placed into js/lib. A new example was added to show as well as test the SVG import.
SVG images are imported as CAG objects, and can be exported as SVG or DXF.
Any comments, issues, bugs, etc would be welcome.
4 comments
4
6 plus ones
6
one share
1
Shared publicly•View activityJeff Gay Correct. The SVG images will become CAG objects (actually source code), which can then be extruded to create 3D objects, etc, etc. SVG images are the new standard for 2D art, so this enhancement should allow people to create some really cool 3D designs. Need an SVG editor? Try one of these. - Inkscape (app) https://inkscape.org/ - ImageBot (online) http://www.flamingtext.com/imagebot/
Mar 10, 2016
Jeff Gay
I just checked in some changes to the DEV branch to fix some issues with scaling. This fixes help scale the SVG image correctly, making both the SVG image and the CAG fairly accurate.Details:
- Changed to use PXPMM if provided on SVG element
- Corrected scaling of units if viewBox is provided on SVG element
By the way, I'm looking for a way to zoom the viewer to exactly 1unit = 1mm. This will allow people to reset the view to something meaningful. Any ideas?
Mar 11, 2016
Jeff Gay
Correct. Zoom to actual size.I know how to determine the screen resolution (pixels per millimeter). But I don't know how to translate this to a "perspective" for the viewer.
Mar 12, 2016
Jeff Gay
FYI, I'm going to take a shot at this, and make the camera position and angle configurable. In addition, the grid size will become configurable. Once done, the viewer will be able to show any size object laying upon a grid that is properly sized, with an appropriate camera position.I'll start another post for discussions.
Please keep this thread for comments and issues around the SVG support.