Grasshopper

algorithmic modeling for Rhino

1.I would be very grateful for your help. After determining the angles of the polyline curve it should be simplified with such restrictions: (see figure in appendix)

α_min≤10° the points are connected at the angle (corner is cropped)

α_max≥45° curve is unchanged

α_min < α_n < α_max some part of the angle is cut off proportionally

I can't delete a repeating segment of the curve.
Is it possible to solve this problem by another way? 

2. The second goal is to simplify the curve segments, which contains many points on small plots.
I found the algorithm (http://www.grasshopper3d.com/forum/topics/simplify-curve-removing-p...),

but it is not something that I wanted (my goal is to averaged points within the angle ᵝ from the point of curve center). Please give me advice if there is another way to solve this task?

Views: 2287

Attachments:

Replies to This Discussion

Removing the sharp spines is fairly trivial, just measure the angle at each corner, remove all vertices that fall under the cutoff angle, then reconnect the remaining ones (hoping there are more than 2 left).

Your second problem sounds much harder, still thinking about that.

Attachments:

Thank you David, but how I can to make the third condition (α_min < α_n < α_max some part of the angle is cut off proportionally)?

Yeah I'm working on that.

Hmm, not sure if you can adjust the attached logic to fit your needs. My approach was as follows:

  • Measure the angle at every corner.
  • Measure the length of each polyline segment.
  • Shift the angles +1 so we know for each segment what angles exist at either end.
  • Map the angle to a {0.5 To 0.0} domain, then multiply that value by the segment length (because we need to cut off corners based both on angle and segment length).
  • Extend each segment with the negative values just computed.
  • Connect all segments back into a polyline.

Another approach you could take might be:

  • Measure angles.
  • Shift angles so you have them for the end of each segment.
  • Scale each segment with some factor that is a combination of the two angles, the scaling centre point should be positioned along the segment, also based on the angles. This will involve some sort of weighting equation.
  • Connect segments.

The benefit of the second approach is that you can easily cut off corners past the mid-point.

ps. I also added a 'remove points too close together from the point of view of the centre of the polyline' solution.

Attachments:

I would be very grateful for your help!
I took a real curve with which I work, and the this definition isn't quite work correct with this curve. There are many unnecessary points even for a small angle (alpha = 02.). With the increasing of angle alpha the number of unnecessary points is decreased, but the original curve is greatly simplified.

Please help me to solve this task. Instead of the group of points of closely spaced to each other that would be only one.

Attachments:

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service