Resampling paths with uniform point count

Post questions on how to use or achieve an effect in Inkscape.
KevinCain
Posts: 4
Joined: Sat Apr 30, 2016 4:03 pm

Resampling paths with uniform point count

Postby KevinCain » Sat Apr 30, 2016 4:15 pm

Could I use InkScape to adaptively resample, or trace, a large group of paths, each composed of a different number of knots? I'd like each of the output paths to have the same number of knots, to keep the the topology sane when I loft the paths into a 3D surface (In Maya, not in InkScape).

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Resampling paths with uniform point count

Postby brynn » Sat Apr 30, 2016 5:38 pm

Some of us might understand what you're asking. But I'm not sure if we have enough info in Inkscape terminology to be able to help. What is it you mean by "knots"? For example, it could be a drawing of a string tied in a knot (I don't think that's it), or maybe you mean nodes (which Illustrator calls "points"). Or I've seen some people refer to gradient stops or other handles as "knots".

Based on what I understand of your message, I would say no. But there's a good chance that either I don't understand correctly, or I've just never heard of such a tool. Here's what I think you're asking.

You want to take an image made up of several to many paths, and somehow recreate them so that they each have the same number of nodes? And for 3d modeling, do you need the nodes to lie on a grid, or be relatively equally spaced? Except for manually tracing the paths, so that you can control how many nodes they contain, the only other way might be with some kind of script. But you'd have to know SVG/XML and scripting codes.

Maybe someone else, who has a better understanding of 3d modeling than I do, can help. I know Blender (another open source project, which is for 3d) can use Inkscape images fairly easily. And I know people who have made paths with Inkscape that they overlay onto a 3d model in Blender (the paths become the texture for the 3d shape). But I don't know what kind of requirements are involved for the paths in Inkscape.

Polygon
Posts: 393
Joined: Thu Dec 19, 2013 3:27 am

Re: Resampling paths with uniform point count

Postby Polygon » Sat Apr 30, 2016 6:36 pm

With the extension "add points" you can spread new points on a curve evenly - but that won´t help you with an 3d-extrusion unless you change all points to corner points. (I believe Maya can do this for you no?)

AddPoints.png
AddPoints.png (132.53 KiB) Viewed 2792 times


Spline Extrusion.jpg
Spline Extrusion.jpg (66.71 KiB) Viewed 2792 times


Cheers
P.

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Resampling paths with uniform point count

Postby Lazur » Sat Apr 30, 2016 8:03 pm

Blender converts paths/curves to mesh by the same number of nodes for each curved segment. (Not sure where to set the default resolution though.)


Other option can be like saving as plt.

Edit: each curved path segment is converted to 12 edges as you can see in the next post.

Polygon
Posts: 393
Joined: Thu Dec 19, 2013 3:27 am

Re: Resampling paths with uniform point count

Postby Polygon » Sat Apr 30, 2016 9:23 pm

Lazur URH wrote:Blender converts paths/curves to mesh by the same number of nodes for each curved segment.

Aha:
BlenderExtrusion.png
BlenderExtrusion.png (21.61 KiB) Viewed 2767 times

BlenderExtrusion2.png
BlenderExtrusion2.png (22.2 KiB) Viewed 2760 times
Last edited by Polygon on Sat Apr 30, 2016 9:28 pm, edited 1 time in total.

KevinCain
Posts: 4
Joined: Sat Apr 30, 2016 4:03 pm

Re: Resampling paths with uniform point count

Postby KevinCain » Sun May 01, 2016 5:51 am

Thank you very much for the lively discussion, which is helpful. To clarify, I should have used the term 'points' rather than knots, for the vertices composing each path.

As suggested, 'Extensions:Modify Path:Add Nodes' looks promising, but I need to maintain the same number of points in each profile -- irrespective of path length, in order to 'loft' between these curves to obtain a surface.

While I could resample the curves outside of InkScape (Blender, Maya, et cetera) it would be helpful to keep the 2D curve editing in InkScape, for better control.

To make my example more concrete, here is a group of paths as an InkScape .svg file:
http://www.insightdigital.org/Claremont/inkscape_topo_example.svg

Here's an view of the same paths:
http://www.insightdigital.org/Claremont ... ample.jpeg

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Resampling paths with uniform point count

Postby Lazur » Sun May 01, 2016 6:55 am

Oh so it's for terrain modelling.

In blender there is an addon for that.
Check it here.


There are other ways to go, like drawing a bumpmap from the isolines and adding a displace modifier.

KevinCain
Posts: 4
Joined: Sat Apr 30, 2016 4:03 pm

Re: Resampling paths with uniform point count

Postby KevinCain » Sun May 01, 2016 7:51 am

Yes, Lazur URH, I'm building a 3D surface from topographic survey data:

http://www.insightdigital.org/Claremont ... s_Maya.jpg

The above image link shows my current approach, importing InkScape SVG paths into Maya (via .AI), setting a height for each and creating a NURBS surface. As you'll see, the resulting topology is a mess (see top image), since each profile curve has a different number of control vertices. Rebuilding the curves in Maya to have an identical number of CVs gives a better surface (see bottom images).

The reason I'd like to rebuild the curves in InkScape, instead, is to potentially have more control over the process. Maya and Blender are focused on 3D operations, of course, so Inkscape's fluency in 2D paths may give more control over the curve resampling process. Or so I hope.

Operations like the Vornoi triangulation or height map approaches you point out sacrifice fidelity to the source curves, which I need to preserve to ensure that the surface passes through (or closely approximate) the source paths.

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Resampling paths with uniform point count

Postby Lazur » Sun May 01, 2016 8:24 am

Maybe the problem is that you try to model the surface as nurbs instead of poly?
With the latter those curves needs to be transformed to meshes and end up part of the surface with no approximation.
(Honestly I haven't tried modelling a terrain from nurbs though I had modelled a few terrains.)

If photorealism is not a must, to represent the isolines the best, simply embossing can be the most straightforward solution.
Architect scale models (like this one) use that alot, it also adds to the plasticity of the shapes.

Polygon
Posts: 393
Joined: Thu Dec 19, 2013 3:27 am

Re: Resampling paths with uniform point count

Postby Polygon » Sun May 01, 2016 7:18 pm

Can you please check the OBJ file attached?
(I used your SVG file rotate&spread the splines accordingly and used a loft script in my SDS modeler)

Cheers
P.
LoftSplines.png
LoftSplines.png (92.82 KiB) Viewed 2637 times
Attachments
Terrain.obj.zip
(59.81 KiB) Downloaded 152 times

KevinCain
Posts: 4
Joined: Sat Apr 30, 2016 4:03 pm

Re: Resampling paths with uniform point count

Postby KevinCain » Mon May 02, 2016 4:58 am

Thanks, Polygon, your resulting mesh topology nicely complements what I showed above in Maya. Did you resample the nodes in the SVG paths in InkScape or in SDS? I'll post my complete model (SVG and OBJ) so you can judge if you're able to improve on my trials in Maya.

I'm still hoping to find a way to control node resampling on InkScape paths, rather than processing externally (SDS, Maya, Blender).

Polygon
Posts: 393
Joined: Thu Dec 19, 2013 3:27 am

Re: Resampling paths with uniform point count

Postby Polygon » Mon May 02, 2016 9:27 am

KevinCain wrote:T. Did you resample the nodes in the SVG paths in InkScape or in SDS?

No resampling - just your SVG in a SubDivisionModeler. No NURBS just B-Splines interpolation patch modeling.

Cheers
P.


Return to “Help with using Inkscape”