I came across a situation in a code that I have been creating where I made an offset of 4 surfaces (the skin of a column solid) and it resulted in creating intersection between the surfaces at the junctions. Is there a way to create a line along the intersection of two surfaces?
Thnks ahead of time!
Yup, Geometry.Intersect should do the trick.
I tried but it didn’t work for me - it just give me the surfaces (what is shown is the result of the Geometry.Intersect node…). Maybe I didn’t use it properly?
So I tried grabbing the first item (first surface) and intersect it with the list of surfaces and it returned the lines.
I then tried the original, feeding the to similar list and changing the lacing to longest and Cross with no success… So I guess the question is if it is possible to return
Grab First Item and Intersect
Intersect 2 Lists of Surfaces
Ok I succeeded!
Turns out that I had to set the level to level 1 for one of the lists.
The list that returns is a bit messy, as in the order of the objects returned - any suggestion on how to make it tidier?
This is because you are intersecting the same geometry, so a surface intersecting itself will return the same surface. You want to intersect the adjacent surface as a surface intersecting another surface that are not coplanar will return a curve (or line if surfaces are planar and overlap).
So assuming surfaces are in some order where they are adjacent either clockwise or counter clockwise, you need to do is shift the list by 1. So create a new list where the last item is now the first item, then do the intersection.
Have a look at this example…
SurfaceIntersectionExample.dyn (20.0 KB)
For completeness, if your surfaces are not sorted CW/CCW, I have added a very simple way to sort them which would suit your geometry…
SurfaceIntersectionExample.dyn (31.8 KB)
I tried adding the ShiftIndices but it still seems to give me the surface along with the lines. I believe that your Surface is also combined as a list of Surfaces?
Let me know if you would like to see the prior code, although I don’t think it will change much as I am trying to manipulate the list of surfaces that is presented…
Yup, this is because your lacing is set to longest, please set to auto. Also, you won’t need to modify which list level you are using, so you can turn that off.
I guess Dynamo doesn’t agree with you (I canceled the levels and changed the lacing to auto).
Ha! Dynamo says no! This is probably the list levels then as the shift indices is just shifting the outermost array, can you flatten your list of surfaces after Surface.Offset then plug that in instead.
Ok, so I flattened the list and it brings me back to start where if I use the same geometry twice - it returns only surfaces
List of Surfaces
and when I use the ShiftIndices it return only partial lines (if I set lacing to cross it returns the messy list like above)
Did you have a look at the simple sort I implemented in the second script I sent? It appears that your surfaces are not in order of adjacency. That is probably why some are intersecting and some are not.
Didn’t try it yet as it seemed a bit more “complicated”.
The surfaces a retrieved from the faces of a column and when I set the lacing to cross it returns each line - twice. Wonder why that is…
Thnx for the help in any case!