Planar curve overlap

Hi everyone,
i have problems in an algorithm to avoid the intersection between ‘filaments’ of two curves.
At the intersection point of the ‘filaments’ I idealize a sphere, selecting 4 points corresponding to the intersection between filaments and sphere: 2 segments are created.
On one of these two segments I create an ‘ellipsoidal bridge’.
In the case of simple intersections, everything works well as in the picture:

In curves with more intersections, the selection of the 4 points (intersection between sphere and filaments) happens fine, but the selection of one of the two segments to build the ellipsoidal bridge doesn’t work, because some spheres overlap.
I grouped in the violet group the components give me errors.

Fibras_random_busano.gh (46.9 KB)

Thanks in advance,
Giorgia

I would have started with something like “Hi, I’m using Laurent’s definition from this other thread, I just deleted the reference panel in my file” :smiley:

jokes apart, is always good and helpful to reference other’s work :+1:




that dispatch you grouped in your edit of Laurent’s file doesn’t wrongly select random segments: it selects segments depending on the point containment, which is based on the initial circle radius you set with the slider

in order to make Laurent’s definition work, the initial circles need to be small enough for each to only contain one single crossing, and of course you can’t have 3 portions of the same curve doing triple overlaps on the very same point like here on A:

don’t be afraid of setting the circle size as small as tolerance allows, as in this other post from Seghier (oh wait what it’s from the very same thread lololol :slight_smile: ) he shows you can use Extend Curve component with negative values, in such a way the circles are just used to identify the trims, but the “length” of the trims/bridges can always be re-set with Extend Curve

I have also this little tool that suppress self intersection, but it transform curve to Polyline.


But it can be converted to line and arcs

suppress self intersection.gh (8.0 KB)

1 Like

Hello @inno ,
You’re absolutely right, next time I’ll cite/not delete the references! Thanks for the advice :blush:.
About the method used by Making bridges on self intersecting curve - #6 by seghierkhaled, I had already tried it, but for the goal I have, I think which I’m using ismore useful.
@laurent_delrieu , thanks for the tool to suppress intersections, but I specifically need those intersections.

My idea is to recreate the deposition of a filament as in the photo (not 3D printing):


The image is from matlab code that generates the coordinates for creating these filaments.
The exported matlab coordinates in GH:

The code works with ARC, and I want to try reproducing non-circular geometries in GH.
At the same intersection point, the filament could be deposited multiple times.
The deposition is without intersecting with previously printed filaments, and there is a little filament deformation (hence the use of that ‘ellipsoidal bridge’).
With matlab coordinates Fibras_random_busano(1).gh (47.2 KB):

I’m thinking of giving GH coordinates to know the order to print the filaments. Do you think it’s possible to achieve this triple-multi-overlap without using a Python script?

I’m also trying to use the Termite tool, but the technique reproduced there is the FDM, fused deposition modeling, and I can’t force (I believe…) the creation of that ellipsoidal bridge.

well, with your new explanation things are much much clearer :+1: thank you for that

I would make use of the Curve | Self intersection component to get a list of points and parameters where intersections happen, and take advantage of the thing that a single crossing generates 2 separate points, which are in “cronological order”, meaning that you can recognise which intersection-point happens first, and which intersection point happens later

this allows you to do something like the following:

where the panel contains ordered indexes of the points that are crossed

this way becomes “easier” to understand how many times you are crossing over the very same intersection, knowing that each time you have to add some Z to create the bridge

Maybe Point Deform can help you

curve_tube.gh (12.7 KB)

K2.gh (35.6 KB)

Maybe K2.

3 Likes

Thank you for the advice you have given me!!
I’m trying to achieve the same ‘not overlap’ as you did, but I’m failing.
Applying K2.gh algorithm and reducing multiplicator factor to bring the filaments closer together:

To get your result (of the figure you uploaded where there are no intersections), I thought of moving in Z also the intersection points (in red). In the ‘move’ block I then inserted the points into which the curve was divided by the ‘target length divide’ and the intersection points, but, of course, in motion I have fewer motion values since the multiplicative factor of ‘motion’ considers only the points of the target length divide.

So I thought of selecting the intersection points with ‘find similar member’ and move them to the same level as the point closest to them:

To make the ellipsoidal bridges, I then reasoned with @laurent_delrieu’s algorithm, which before didn’t work for me because the circumferences intersected, but now those circumferences are in different planes. It doesn’t work at all… I am unable to find the error and to solve the problem.

Reference file:
Fibras_random_busano_2.gh (44.1 KB)

K2 v1.gh (56.4 KB)
V8 is not required.

2 Likes

Thank youuuuuu! :slight_smile: