Curve.JoinCurves failure

Why do these 4 curves fail to join with Curve.JoinCurves?
I have tried many tolerance values and am always ignoring direction.
Yet they succeed with Join on the commandline

{"version":10000,"archive3dm":80,"opennurbs":-1871145375,"data":"+n8CAIEAAAAAAAAA+/8CABQAAAAAAAAA29TXTkfp0xG/5QAQgwEi8PSb6SP8/wIASQAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAeUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB5QAIAAAB3dQhO/38CgAAAAAAAAAAA"}
{"version":10000,"archive3dm":80,"opennurbs":-1871145375,"data":"+n8CAIEAAAAAAAAA+/8CABQAAAAAAAAA29TXTkfp0xG/5QAQgwEi8PSb6SP8/wIASQAAAAAAAAAQAAAAAAAAAAAAAAAAAABEQAAAAAAAAAAAAAAAAAAAeUAAAAAAAABEQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB5QAIAAAAChKjS/38CgAAAAAAAAAAA"}
{"version":10000,"archive3dm":80,"opennurbs":-1871145375,"data":"+n8CAF4BAAAAAAAA+/8CABQAAAAAAAAAGRGvXlEL1BG//gAQgwEi8EoaeRf8/wIAJgEAAAAAAAARAwAAAAEAAAADAAAABQAAAAAAAAAAAAAAAAAAAAAA8D8AAAAAAAAAAAAAAAAAAAAAAAAAAAAA8L8AAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAABeOFUpemo/QF44VSl6aj9AXjhVKXpqT0BeOFUpempPQAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwP8AKHwDGSCzAAAAAAAAAAAAAAAAAAAAAAM07f2aeoOY/AAAAAAAANMAAAAAAAAA0QAAAAAAAAAAAAAAAAAAA8D/BCh8AxkgswMAKHwDGSDxAAAAAAAAAAADNO39mnqDmP2pXLBMnWPa8AAAAAAAAREAAAAAAAAAAAAAAAAAAAPA/AKt6jeb/fwKAAAAAAAAAAAA="}
{"version":10000,"archive3dm":80,"opennurbs":-1871145375,"data":"+n8CAF4BAAAAAAAA+/8CABQAAAAAAAAAGRGvXlEL1BG//gAQgwEi8EoaeRf8/wIAJgEAAAAAAAARAwAAAAEAAAADAAAABQAAAAAAAAAAAAAAAAAAAAAA8D8AAAAAAAAAAAAAAAAAAAAAAAAAAAAA8L8AAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAABeOFUpemo/QF44VSl6aj9AXjhVKXpqT0BeOFUpempPQAUAAAAAAAAAAAB5QAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwP2JuEpA1y3BAAAAAAAAAAAAAAAAAAAAAAM07f2aeoOY/AAAAAADAd0AAAAAAAAA0QAAAAAAAAAAAAAAAAAAA8D9ibhKQNctwQMAKHwDGSDxAAAAAAAAAAADNO39mnqDmPwAAAAAAAHlAAAAAAAAAREAAAAAAAAAAAAAAAAAAAPA/AOu7HxX/fwKAAAAAAAAAAAA="}

Hi @david.birch.uk,

Please post a 3dm file and the code you’re using.

Thanks,

– 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