[vtkusers] How would you go about converting an SVG file into 3D mesh

Cory Quammen cory.quammen at kitware.com
Tue Aug 22 09:21:54 EDT 2017


On Tue, Aug 22, 2017 at 4:27 AM, alican <alican1812 at hotmail.com> wrote:

> I have an SVG file, that I would like to convert into a mesh. It should
> have
> some depth, but the depth and Z position can be the same for all points. I
> have thought about getting all points coordinates from SVG and adding the
> same z to all points, then duplicating the process with a slightly
> different
> z, then merging these 2 data sets into one mesh.
>
> There is at least 2 problems with this approach:
> 1) it is slow and inefficient
> 2) if there are some shapes in the SVG, I do not have real points, I need
> to
> create the points first, for example, I have 2 centers and 2 radiuses for
> an
> ellipse, so I can generate some points on this ellipse' curve.
> This makes the process even more slow.
>
> What would be a more efficient approach, if there is one?
> Thanks
>
>
>From a complexity standpoint there can't be a more efficient way to do this
than you have described. You need to iterate over the points in the SVG
file at least once, which you do in your algorithm. There may be tweaks you
can do such as generate points with the same x,y value and different z
values at the same time and store these in your mesh, but that is a
constant performance improvement. Unless you are dealing with billions of
points, what you describe should be quite fast on any computer.

Cory


> --
> View this message in context: http://vtk.1045678.n5.nabble.
> com/How-would-you-go-about-converting-an-SVG-file-into-
> 3D-mesh-tp5744549.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>



-- 
Cory Quammen
Staff R&D Engineer
Kitware, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170822/41eff190/attachment.html>


More information about the vtkusers mailing list