Grasshopper

generative modeling for Rhino

# Concavity/Convexity test on closed Curves or Breps?

Hi all,

Well the question is in the title. Is there a way to test for this property, other than sampling and per-maybe-haps using isovist? the trouble is in the sampling part you can imagine. I have not tried to tackle this yet, so I'm just throwing the question in...

Cheers,

Fred.

Views: 319

### Replies to This Discussion

Hi Fred,

Huh sorry I meant like this...

I should have said convex and non-convex to be precise - but I did say closed, didn't I? ;)

Rough definition of convex : if you have a region (2d or 3d), take two arbitrary points within it and draw a line. If the "shape" is convex the the line will never cross the region boundary.

so a sphere or a cone are convex, a torus isn't.

Thanks for your input Dany, always first on deck to help people in trouble. But I'm not a beginner really! I'm thinking actually I might move this post to the vb forum. It must have been implemented in some open library. I hope...

I missed the closed :) no worries.

There's nothing ready made for this. One interesting approach could involve Convex hull. If a curve is purely convex, it will be similar to the convex hull of all the points that make up the curve. Also if a curve is convex it means its control-point-polygon will also be convex. Comparing the control-point-polygon to its own convex hull may give you the answer.

--

David Rutten

david@mcneel.com

Yes you're right, I'm gonna look into this. Thank you David.

On second thought, are you sure that the opposite is true? If the control points polygon is non-convex then the curve is non-convex too? and what about CP weights?

Yeah you're right, it is possible for the control-point-polygon to be concave while the curve remains convex.

--

David Rutten

david@mcneel.com

Hi,

Once I had a quite similar question,

how one could "read out" the results of the crvgraph into a list.

angelos

Well that one is easy, use the curvature component!You can check for curvature discontinuity with the ... discontinuity component.

Thank you for this one fred,

exactly what I was after.

(for the definition I am using, this results (+ to - change)

show me if the curve remains convex or not)

angelos

• View All