Curve Intersection Fail (returns null)

Anyone know why I get a Null Exception on
Intersection.CurveCurve with tolerances 0.001

I tried CurveCurveValidate but it sheds no light :frowning:

{\"version\":10000,\"archive3dm\":80,\"opennurbs\":-1871145343,\"data\":\"+n8CAIEAAAAAAAAA+/8CABQAAAAAAAAA29TXTkfp0xG/5QAQgwEi8PSb6SP8/wIASQAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPjPQYwh+d0AAAAAAAAB5QAAAAAAAAAAAAAAAAAAAAAB+CIPrJCeBQAIAAAA0Rqdg/38CgAAAAAAAAAAA\"}

{\"version\":10000,\"archive3dm\":80,\"opennurbs\":-1871145343,\"data\":\"+n8CAOkCAAAAAAAA+/8CABQAAAAAAAAA5tTXTkfp0xG/5QAQgwEi8E6cu9v8/wIAsQIAAAAAAAAQFQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFTAAAAAAAAANEAAAAAAAAAAADBcc+k5y0JAAAAAAAAAREAAAAAAAAAAANCjjBbGNEXAAAAAAAAATkAAAAAAAAAAADJcc+k5y1JAAAAAAAAAVEAAAAAAAAAAAOA8ymhhTBPAAAAAAAAAWUAAAAAAAAAAAEwKLd7WMFxAAAAAAAAAXkAAAAAAAAAAAJgUWrytYUBAAAAAAACAYUAAAAAAAAAAADNcc+k5y2JAAAAAAAAAZEAAAAAAAAAAAGa45tJzllFAAAAAAACAZkAAAAAAAAAAAEAz0GMIfmdA////////aEAAAAAAAAAAAIBmoMcQ/FpA//////9/a0AAAAAAAAAAAEsKLd7WMGxA////////bUAAAAAAAAAAAEsKLd7WMGJAAAAAAABAcEAAAAAAAAAAAKzwRKzScXBAAAAAAACAcUAAAAAAAAAAAFjhiVil42ZAAAAAAADAckAAAAAAAAAAADJcc+k5y3JAAAAAAAAAdEAAAAAAAAAAAGS45tJzlmtAAAAAAABAdUAAAAAAAAAAALjHoSahJHVAAAAAAACAdkAAAAAAAAAAALjHoSahJHBAAAAAAADAd0AAAAAAAAAAAD4z0GMIfndAAAAAAAAAeUAAAAAAAAAAABUAAAAAAAAAAAAAAEnoW0CTnVRAZHO+MaI3aUDEM/boNcNxQGRzvjGiN3lAdm3VAQdffkCL1k6luemCQJRTWg1sfYVAZHO+MaI3iUBt8MmZVMuLQD0QLr6KhY9Ao8Yck54MkUCL1k6luemSQBCVVNmSM5RA+KSG660QlkB9Y4wfh1qXQGVzvjGiN5lA6jHEZXuBmk
DSQfZ3ll6cQFcA/KtvqJ1APxAuvoqFn0ADAAAAkGPNiv9/AoAAAAAAAAAAAA==\"}

Hi @david.birch.uk,

Can you provide the curves (in .3dm form) and the code you are using?

– Dale

Huge thanks to @Joshua_Kennedy who spotted that the curves (as exported above) have different dimensions (2d vs 3d). This means that as the Join (and Intersection) routines in RhinoCommon expect the curves to have the same dimensions - they reject the input and return null. The solution is to call ChangeDimension(3) on both curves first.

It would be super handy if this could be documented in the API notes :wink: e.g. Curves must be of same dimension (so both 3d vs 2d)

@dale The reason that the Join always succeeds once the curve have been added to the document (and so i didn’t share a 3dm) is that

“Rhino automatically raises a 2D curve to 3D when it’s passed to the document. It’s part of a small “cleanup” routine in AddObject”

in RhinoCommon we have todo that ourselves :laughing:

1 Like