Remember your own conventions: lines run along positive Z

This commit is contained in:
Thomas Krijnen
2024-06-11 14:14:47 +02:00
parent 4331f4f785
commit d400a48a9d
+10 -2
View File
@@ -83,7 +83,7 @@ namespace {
curve_creation_visitor_result_type operator()(const taxonomy::line::ptr& l) {
const auto& m = l->matrix->ccomponents();
return result = Handle(Geom_Curve)(new Geom_Line(OpenCascadeKernel::convert_xyz2<gp_Pnt>(m.col(3)), OpenCascadeKernel::convert_xyz2<gp_Dir>(m.col(0))));
return result = Handle(Geom_Curve)(new Geom_Line(OpenCascadeKernel::convert_xyz2<gp_Pnt>(m.col(3)), OpenCascadeKernel::convert_xyz2<gp_Dir>(m.col(2))));
}
curve_creation_visitor_result_type operator()(const taxonomy::circle::ptr& c) {
@@ -198,7 +198,15 @@ bool OpenCascadeKernel::convert(const taxonomy::loop::ptr loop, TopoDS_Wire& wir
TopTools_ListOfShape converted_segments;
for (auto& segment : loop->children) {
auto segment_wire = boost::get<TopoDS_Wire>(convert_curve(this, segment));
TopoDS_Wire segment_wire;
try {
segment_wire = boost::get<TopoDS_Wire>(convert_curve(this, segment));
} catch (...) {
// @todo we should do some better logging here and catch specific exceptions
// but most notably we just want to continue processing when there are
// duplicate vertices in our loop (or remove them earlier in the mapping?).
continue;
}
#ifdef IFOPSH_DEBUG
std::ostringstream o;