Grasshopper

algorithmic modeling for Rhino

Once a list of curves are flipped to match a guide curve, shouldn't they have a consistent direction?
Should this be possible?

Views: 1504

Replies to This Discussion

Hey Benjamin

They have all been fliped into one single direction to match that of the guide crv what the panel is saying is if they have need to be fliped to match the direction of the guide crv.

Hope this Helps

matt
Well, if the Guide-alignment code was perfect this should not have happened. I think it merely samples both curves at some dynamic interval then takes the majority votes of the number of times they seemed to align and the number of times they didn't.

Are these curves clearly supposed to get aligned, or is the curve that's being flipped twice very different from the Guide curve?

I'll have to bash a few brains in the Seattle math division against the wall, see what falls out. They might have a better idea on how to determine alignment.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
the guide curve and the flipped curves are all closed and planar, but the guide curve is a rectangle, while the flipped curves are a wide variety of complex shapes. My intention was to ensure that all of the curves had a consistent direction, irrelevant of what that direction was.

In case it helps, here was my work around for these closed curves:

for each curve:
evaluate at two parameters, very close together, such as 0.45 and 0.46 (reparameterize)
get the vector from the centroid to each evaluated point.
measure the angle between the two vectors. The result will be an angle close to 0.0 or 2pi.

select all the curves for which the angle is greater than 1.0 and flip them.

This should result in the curves being all clockwise or all counter clockwise.

And please, don't use violence.
Also,
Is it possible for a curve to be closed but not periodic?

Closed is just that the start/end points are at the same place. Periodic means that there is no apparent start/end (the end part of the curve will be affected by control points at the start of the curve making it as if the start-end part of the curve was another continuous segment) and therefore no kink.
thank you. that makes complete sense.

there is no need for violence - nice workaround! ,also works in 3d if you generate a plane from the control pt of the polygon with plane fit and input this one as the plane of the angle measurement.   

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service