Geom2dAPI_InterCurveCurve with Geom2d_OffsetCurve

IcyTrooper's picture

Hello,

I've got an issue when using Geom2dAPI_InterCurveCurve with Geom2d_OffsetCurve. This is a simplified version of what I'm doing: am I missing something?

Handle( Geom2d_Line ) hLine1 = new Geom2d_Line( gp_Pnt2d( 1.0, 0.0 ), gp_Dir2d( 0.0, 1.0 ) );

Handle( Geom2d_Line ) hLine2 = new Geom2d_Line( gp_Pnt2d( 0.0, 1.0 ), gp_Dir2d( 1.0, 0.0 ) );

//This works fine
Geom2dAPI_InterCurveCurve oTest1( hLine1, hLine1, Precision::Confusion() );

Handle( Geom2d_OffsetCurve ) hOffsetLine1 = new Geom2d_OffsetCurve( hLine1, 0.3 );
Handle( Geom2d_OffsetCurve ) hOffsetLine2 = new Geom2d_OffsetCurve( hLine2, 0.3 );

//This throws Standard_DomainError exception.
Geom2dAPI_InterCurveCurve oTest2( hOffsetLine1, hOffsetLine2, Precision::Confusion() );

Please let me know if this type of question should be posted elsewhere.

Cheers,
Ian

abv's picture

Try to debug

Hello Ian,

Just a guess, it may be that offset curves must be limited (in your case they are infinite) for intersection to work. Try to run in debug mode and step into the code to see the actual reason.

For the future, consider posting questions of this kind to forum at www.opencascade.org.

Andrey

IcyTrooper's picture

Thanks for the info :)

Thanks for the info :)

www.opencascade.com

Copyright 2011-2019
OPEN CASCADE SAS
Contact us