Yang Yang Tue, 09/26/2023 - 12:30 Forums: Visualization and 3D Viewer David Swall Mon, 01/15/2024 - 14:11 bool WidgetOccViewController::deterLine(TopoDS_Edge anEdge) { BRep_Builder b; TopoDS_Wire w; b.MakeWire(w); b.Add(w, anEdge); BRepAdaptor_CompCurve C; C.Initialize(w, false); GCPnts_UniformAbscissa UA(C, 6); TColgp_Array1OfPnt anArrayofPnt(1, 6); for (int i = 1; i <= 6; i++) anArrayofPnt.SetValue(i, C.Value(UA.Parameter(i))); GProp_PEquation PE(anArrayofPnt, 1); if (PE.IsLinear()) { return true; } return false; } Log in to post comments
Mon, 01/15/2024 - 14:11
bool WidgetOccViewController::deterLine(TopoDS_Edge anEdge)
{
BRep_Builder b;
TopoDS_Wire w;
b.MakeWire(w);
b.Add(w, anEdge);
BRepAdaptor_CompCurve C;
C.Initialize(w, false);
GCPnts_UniformAbscissa UA(C, 6);
TColgp_Array1OfPnt anArrayofPnt(1, 6);
for (int i = 1; i <= 6; i++)
anArrayofPnt.SetValue(i, C.Value(UA.Parameter(i)));
GProp_PEquation PE(anArrayofPnt, 1);
if (PE.IsLinear())
{
return true;
}
return false;
}