Geometry.DoesIntersect should return true but doesn't

Goodday,

I created a python script which constantly checks if lines do intersect.
I have a center curve which is compared with all different kinds of lines.

for almost every instance this python script works, but i get some random errors.

there is this line which i think intersects with the bottom curve. Geometry.Intersect gives me a intersection point. Geometry.DoesIntersect however gives me a false?

What am i doing wrong?

Cheers,

Try to change lacing

Looks like a geometry scaling issue.

@jacob.small,

As in it won’t recognize the intersect at all?
we’re using Revit in milimeters so the coordinates are all x1000.

Without the minimal data set to reproduce the issue we are guessing at the possible causes, but that the curve looks odd makes me think it is a geometry scaling issue. Try on Medium scaling and see if that fixes things; if not try temporarily bumping up the units to M and bumping the geometry scaling. If either combination is at play you know why the issue is.

@jacob.small,

you’re right! i’ve tried to recreate the same thing to upload but that seems quite hard…
the python scripts works on a maximum of itterations so i have to manually find the number of itterations on which it crashes. And explaining it is to hard since some things don’t work yet :frowning:

but i found out that is has something to do with the geometry scaling. recreating lines and arcs in dynamo with the exact same coordinates gives me other values. I will try to scale it to M, maybe that will work.

If you would still like the dynamo script to recreate the issue give me a shout. but it will need some extra explaining to understand.

edit: wrong image

If you’re making headway than perhaps best to keep trying to solve it with this guidance. Just be sure to let us know where you get to once done. :slight_smile:

@jacob.small

Found the issue:

I use a detail/model line as input for the script. this is the curve that intersects with the line. My python script wasn’t ready for a polycurve so i made an offset (value 0) of a polycurve (this returns a single curve).

the offset curve is somehow segmented by dynamo/revit, this makes it less precise and returns random intersection errors. The problem is solved when i feed the script with a direct detailcurve.curve. now i just need to adjust my python script so i can feed it a direct polycurve.

p.s. the warning in DetailCurve.Curve is a geometry scaling warning

1 Like