mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 02:02:22 +00:00
Fix 2 segfaults creating IfcEllipseProfileDef
1) taxonomy::ellipse was missing matrix so create_shape was segfaulting either was if Position was set or was not (segfaulting on line - https://github.com/IfcOpenShell/IfcOpenShell/blob/5616367a03ea397885e93523e55788da82238742/src/ifcgeom/kernels/opencascade/loop.cpp#L92) 2) was segfaulting when there was no default matrix Removed fc->matrix assignment as matrix is already assigned to the curve.
This commit is contained in:
@@ -39,6 +39,9 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcEllipseProfileDef* inst) {
|
||||
#endif
|
||||
if (has_position) {
|
||||
m4 = taxonomy::cast<taxonomy::matrix4>(map(inst->Position()));
|
||||
} else {
|
||||
// matrix needs to be set on elementary curves.
|
||||
m4 = taxonomy::make<taxonomy::matrix4>();
|
||||
}
|
||||
|
||||
if (ry > rx) {
|
||||
@@ -58,9 +61,9 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcEllipseProfileDef* inst) {
|
||||
auto el = taxonomy::make<taxonomy::ellipse>();
|
||||
el->radius = rx;
|
||||
el->radius2 = ry;
|
||||
el->matrix = m4;
|
||||
ed->basis = el;
|
||||
lp->children.push_back(ed);
|
||||
fc->children.push_back(lp);
|
||||
fc->matrix = m4;
|
||||
return fc;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user