Am starting 2021 stuck (as usual) with what is probably a pretty basic problem
I’m developing a little definition to help me draw in plan using multi-line curves that snap and intersect themselves (a bit like the way Revit and Microstation do) I’m also using this as an opportunity to learn data trees better.
I have drawn a few random boundaries and internal walls within them from single crv’s that I would like to offset and auto-join themselves, I have sorted them into a list that Identifies the following…
- Three (in this case) closed boundaries
- The six points where the internal walls intersect with the boundaries
- A True/False pattern for each point that indicates which boundary it meets with
Ideally what I would like is to sort the points into a list that assigns the points to the boundary they are associated with, for this case it should be Zero for boundary (0) One for boundary (1) and Five for boundary (2) - Once I have that I can solve the intersections and move forward to create nice closed shapes.
I can’t use dispatch as it only separates the True/False pattern and doesn’t sort them to the identity of the boundaries and the weave components don’t seem to do it either, is there a tool for this that I am missing here?
It’s a longer definition so I have cropped out the problem part and internalised the data.
Any help would be greatly appreciated!
01-03_PLAN-DRAWING_REVA.gh (15.8 KB)
I did read this sentence other times… wanna bet?
I admit I lost you while reading the description of your “pretty basic problem”…
Is this any useful?
This is a kind of brute force solution without thinking of data tree…
Riccardo, thankyou for the quick reply
That little trick with the item index ending in construct path seems to be working great Not sure I fully understand how it works but I’ll look at it more closely tonight! I did have to do some cleaning up and re-direct the keys list from the source geometry as when I went to shatter them for some reason the indices were all out of alignment
Anyway the cleaned up version is attached and they belong to the correct trees now - thanks for your help!
01-03_PLAN-DRAWING_REVA_re2.gh (13.3 KB)
Thanks again for your help - although Riccardo answered my exact query, I might be overthinking the definition as a whole by using trees etc. at the moment I am just solving the instance of interior walls that connect to the out walls on one end, but there are other scenario’s like walls that connect at 2 points, that connect from outside the shape or that don’t connect at all etc.
When accounting for all these variables your method could be simpler, I’ll try both when the definition gets more complicated and we’ll see what happens
Kim’s solution should be pretty solid … i mean, reliable!
This is another approach:
Difficult to say what method is faster with just a dozen of curves…
If you need performance, you will probably end up using curve-curve intersections and obtaining something “low level” that works fast. (curve parameters, shatter, etc etc)
You have your design in millimeters and far from origin.
I tried simple curve booleans and saw 1 minute calculation just for the bigger room curve subtracted by the curved wall… even if moved near origin (maybe it is a bug?)
Okay so I started over and used bits and pieces from a few of the previous ideas and finished with something that I’m pretty happy with, the def does the following…
- Auto detects and separates the boundaries from the open walls, identifies open walls that are inside and connecting with the boundaries and makes sure the boundary normal’s are flipped internally
- uses regions to solve the intersections *with the solids from the brute force option it was lagging a bit and my original tree approach was over-complicated; I’m finding that regions make for a shorter more efficient definition and isn’t slowing down when drawing a plan (you really want that instant feedback when drafting)
- subtracts regions to make a handy area calculation for the internal spaces
So far it doesn’t seem to get confused by walls outside, inside, connecting with one point and connecting with two points that divides the spaces. From here I’m thinking to develop it further to have multiple wall thicknesses and add doors & windows in determined by points.
Full definition is attached below, there’s a data stream to a layer ‘walls’ to draw on - If anyone has any further thoughts on improvements feel free to suggest them
01-03_PLAN-DRAWING_REV-E.gh (18.1 KB)