resampling curves

   5668   4   1
User Avatar
Member
32 posts
Joined: July 2005
Offline
I?fm having some trouble taking a curve and resampling the number of points in it precisely and still maintaining the exact start and end points while keeping the points evenly spaced and also matching the input curvature very very closely.

resample produces excellent curvature but doesn?ft end at exactly the same spot and when it does the last point isn?ft evenly spaced.

settings for resample are:
LOD: 10
even length segments
along arc
maximum segments: 1999

I want 2000 points so 1999 segments should give a start and end point matching orginals and 1999 segments along the original curve evenly spaced. But they aren?ft. And the end point doesn?ft often match.

I can match it by choosing max seg length and turning on maintain last vertex, but then again the last one is added as an after thought and isn?ft the same distance as the others and with this method I can?ft control the number of points precisely. Also the last segments curvature often doesn?ft match the rest of the curve.

polyspline produces a excellent curvature but doesn?ft care about the start or finish point much. Even when you raise the CV count you only get close to the original end and start of the input curve. I can produce exact amounts of points that are perfectly spaced but I can?ft get the start and end nailed.

Any ideas on other things to use to do this?

Fit doesn?ft at this time appear useful.
Refine also doesn?ft appear useful.

I am taking these curves and filleting them and then joining them to make one curve.

So I take my input curves and convert them to nurbs before the fillet. That seemed to help make a much better fillet.
The join looks better for some reason if nurbs go in.

The output has irregular point spacing so I need to resample it or polyspline it as above. But it is critical that the end points line up exactly.

-mikey
User Avatar
Member
11 posts
Joined: July 2005
Offline
Hello Mikey,

maybe this works for you:

Convert your curve with a convert-sop to polygon and then resample this
with resample sop :
LoD:1
Methode: even length segmemts
Measure: along arc
maximum segment length:1999

Playing (higher numbers) with the u- and v- pararmeters in Level of Detail in the convert sop let you better fit the resample curve to original curve


i hope this is want you want.

dobe
User Avatar
Member
32 posts
Joined: July 2005
Offline
Actually with LOD of 1 you will get many of the points in straight lines even though you have a high segment count.

My problem isn't with understanding resample it's with how resample works.

LOD10
even length segments
along arc
max segments 1999

This should yeild a polygon curve that very very closely matches original.
It should be made of 2000 points. The start and end points should match the original curves start and end points EXACTLY and the points should all be evenly spaced along the arc length.

Routinely the last point gets dropped so you don't end up with 1999 segments. Even if the segment number is correct frequently the end point is not exactly in the right spot. Zoom in very very very close and you'll see what I mean. Change the LOD and the end point will hop around. It should not.

I submitted this and it might be a bug or by design, they are looking into it.

For now, i use resample and I delete all but the end points and start points of the original. Then I join those. This gets me close but the start and end points are no longer evenly spaced. At least with this method I can match the curve shape and get the correct point count and match start and end, but even spacing loses.

Any other ideas to get even spacing would be great.

Thanks much…
-mikey


dobe
Hello Mikey,

maybe this works for you:

Convert your curve with a convert-sop to polygon and then resample this
with resample sop :
LoD:1
Methode: even length segmemts
Measure: along arc
maximum segment length:1999

Playing (higher numbers) with the u- and v- pararmeters in Level of Detail in the convert sop let you better fit the resample curve to original curve


i hope this is want you want.

dobe
User Avatar
Member
32 posts
Joined: July 2005
Offline
Hi Michael,

Unfortunately this is a floating point tolerance issue.

To minimize the error:

You can scale your geometry by a scale factor, say 100, and then go much
higher before the errors occur this is because of the use of fixed sized
tolerances internally.

The next best option is to manually snap the last point to the correct
value. This can be somewhat automated as every X point is the end point.

Hope this helps and get back if you need more info,
DavidMarcus
User Avatar
Member
32 posts
Joined: July 2005
Offline
Cool, both good ideas. I'll try scaling the original curves down before resampling then scaling them up after to see what happens.

Thanks much…
—–

I like the idea of using polyspline to get a really nice match to the curve.
Then I can delete all but the start and end point in the oringinal curve and use edit to snap point 0 and 1999 onto the original start and end. This will get as close as possible to what I'm looking for without scaling the objects first though I'll try that too.

Thanks all…

-mikey
  • Quick Links