Boundary/Outline "Contest" GH/C#

Ok guys here’s the thing i need to get the outline of such shapes stacked one on another i tried to tackle this many times but always it was like - eh maybe i will figure it out down the way. So im dropping here internalized data: (207.1 KB)

I’d like to invite you guys @RIL @RadovanG @qythium @clement @HS_Kim

Wonder what tactics will be used here :sweat_smile:


As you can see in my attached def, if your polylines are projected onto some sort of curved surface, you can use that to get the boundary curves using Region Unionon the world XY plane.
BTW, you don’t have to invite a few people over for a contest. Just ask your question. Who knows if anyone can help? (32.5 KB)


Thanks @HS_Kim for input :slight_smile:

This was just a small recall of Curve.Contains Method too slow where few of us had just fun of improving over and over code to get best possible preformance :wink:

I was going down a similar line to HS_Kim, but projected the points back to the curves to get the outline in place. (26.6 KB)

1 Like

The power of collective intelligence.:smiley:

@HS_Kim @Adam_M Ok guys i tried both but we have small problem unfortunatelly due to my oversimplification of prepared data. I updated first post with proper complex set.

Thats why started this party :sweat_smile:

This play gets confused at three points where the line of hexagons crosses itself: (49.5 KB)

P.S. My method was different but I too made an assumption based on your original post that fails with your updated - back to the drawing board. :frowning:

Don’t worry be happy :slight_smile: I have already at least 20+ defs which doesn’t work :laughing: Fun starts when shape starts to change we still consider simplified version :smile:

It’s better though to have the spec/data correct from the beginning instead of wasting time on misleading assumptions. Changing the spec is called “moving the goal posts”. :wink:

Hi guys!
… can i barge in? (235.3 KB)

Interesting challenge!

I’ve not deeply tested but it seems to work.

The idea I followed was to:
For every curve “C” find the best fitting plane, will call it “P”.
Shatter every curve dependings on all the intersections found by MCX.
For every segment find mid-point.
Create a sub-lists containing all the curves that have one or more intersection with current C curve and project every of them to the relative P plane.
Do the curve-inclusion test for every mid point with all the projected curve, keep only mid-points (segments) that are always outside.

The explanation is harder than the concept itself…

Is this some sort of manual “paint” on mesh?

Edit: sorry i forgot to upload the file … silly me


This is enough to figure out methodology how to approach this - maybe one missing thing is that further we’ll have to add next outline to this outline or subtract from them other outline but i know it will be easy when we’ll grasp low level stuff here :slight_smile:

@maje90 Ahh of course everybody is welcome :slight_smile:

Give me a sec to grasp it :face_with_monocle:

Bingo! Actually, i want to do nondestructive curve bounded paint in full degree of freedom not constrained to any projection plane.

My solution still uses projection, not globally but locally.
I think it would work in most cases, but if your “stamp” (the hexagon) is created in a very curved space (with adjacent hexagons even more curved) it will probably fail too.

The solution would be trimming the actual mesh/brep with each stamp and use that… very heavy…

Thats why i’m reaching out. My most succesfull approach was using simplified spheres joined and intersecting them with underlying geomety. However it’s not cheap to compute. Probably next step here would be to try adaptive marching cubes with adaptive iso to create multires metamesh and then check for intersection - but i guess there’s something what im missing here and whole procedure could be simplified.

@Adam_M you can use everything to acomplish :slight_smile: Thing is - as always - to do it cheap in terms of computation time / consumed resources.

You are giving us a list of hexagons, like it is a single input as a “whole”.
To paint i think the best idea would be to do it iteratively.
Now you have 100 hexagons solved in 100ms (for example)
With the 101th hexagon it will recalculate everything again and take again 101ms … not smart.

If you have a “brush” i would store last position and draw a line from center to center and so on…
Or at least do the hexagons intersection one by one WHILE the drawing is done…

The context is huge…

Well it is exactly like that if you consider how any kind of brush works - you have a pointer so in general, you will draw a “curvy” shape but instead of that you sample the move each x step let say pixels on screen or units in doc or whatever (usually called brush spacing) in place of sample (point) you’ll place a “stamp” but in general what you do iterativly add shape after shape to previous lets call it stroke/ boundary.

I’m giving “random set of stamps” since it would be hard to share movement as internalised data - ok we could use mass adition to reveal each time unit next step :wink:

That actually would be very interesting if it could be handeld in gh during such motion :slight_smile:

I’m not so sure about that.

The hexagons are inconsistent with regard to curve direction so it’s not possible to determine orientation of planes created from them. If they had consistent “surface normals”, this would be relatively easy, but as is, the task is cleaning up junk data. I’d rather take a walk. Ciao.

Not consistent ? Each stamp is conformed to mesh normal and then pulled to fit exact shape of it so if you are calling junk data pulled curves which are intersecting exactly ON mesh well … Here you have whole set if it helps in anything (664.0 KB)

Consider that you are asking for “stamps” aligned to curve which wont be aligned to curve since there won’t be any curve.

No thanks, I’m not that interested anymore. Good luck.

In this model, I used Anemone to first flip curves so they all have the same orientation:

OUTLINE_DATA_COMPLEX_2019Jul4b2 (222.7 KB)

1 Like

Sure, anyway thanks for your time and input i’ll look at it :slight_smile:

Still some problem with my logic inside a C#. TBC