mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-05 23:41:44 +00:00
Process entities with the "Facetation" RepresentationIdentifier too
Fixed a bug in the rendering of IfcTrimmedCurve Inverted the resulting transformation of IfcCartesianTransformationOperators
This commit is contained in:
@@ -140,7 +140,8 @@ bool IfcGeom::convert(const Ifc2x3::IfcCartesianTransformationOperator3D::ptr l,
|
||||
if ( l->hasAxis3() ) IfcGeom::convert(l->Axis3(),axis3);
|
||||
else axis3 = axis1.Crossed(axis2);
|
||||
const gp_Ax3 ax3 (origin,axis3,axis1);
|
||||
trsf.SetTransformation(ax3);
|
||||
trsf.SetTransformation(ax3);
|
||||
trsf.Invert();
|
||||
if ( l->hasScale() ) trsf.SetScaleFactor(l->Scale());
|
||||
CACHE(IfcCartesianTransformationOperator3D,l,trsf)
|
||||
return true;
|
||||
@@ -153,6 +154,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcCartesianTransformationOperator2D::ptr l,
|
||||
if ( l->hasAxis1() ) IfcGeom::convert(l->Axis1(),axis1);
|
||||
const gp_Ax2d ax2d (gp_Pnt2d(origin.X(),origin.Y()),gp_Dir2d(axis1.X(),axis1.Y()));
|
||||
trsf.SetTransformation(ax2d);
|
||||
trsf.Invert();
|
||||
if ( l->hasScale() ) trsf.SetScaleFactor(l->Scale());
|
||||
CACHE(IfcCartesianTransformationOperator2D,l,trsf)
|
||||
return true;
|
||||
|
||||
@@ -159,7 +159,8 @@ IfcGeomObjects::IfcGeomObject* _get() {
|
||||
|
||||
// Has the list of IfcProducts for this representation been initialized?
|
||||
if ( ! entities ) {
|
||||
if ( shaperep->RepresentationIdentifier() != "Body" ) {
|
||||
if ( shaperep->RepresentationIdentifier() != "Body" &&
|
||||
shaperep->RepresentationIdentifier() != "Facetation" ) {
|
||||
_nextShape();
|
||||
continue;
|
||||
}
|
||||
@@ -219,7 +220,7 @@ IfcGeomObjects::IfcGeomObject* _get() {
|
||||
|
||||
if ( (openings && openings->Size()) || use_world_coords ) {
|
||||
if ( shape ) delete shape;
|
||||
TopoDS_Shape temp_shape (shapes);
|
||||
TopoDS_Shape temp_shape = shapes.Moved(gp_Trsf());
|
||||
try {
|
||||
if (openings && openings->Size()) IfcGeom::convert_openings(entity,openings,temp_shape,trsf);
|
||||
} catch( IfcParse::IfcException& e ) {Ifc::LogMessage("Warning",e.what()); }
|
||||
|
||||
@@ -212,7 +212,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcMappedItem::ptr l, TopoDS_Shape& shape) {
|
||||
trsf2 = trsf2_2d;
|
||||
}
|
||||
if ( ! IfcGeom::convert_shape(map->MappedRepresentation(),shape) ) return false;
|
||||
shape.Move(trsf2 * trsf1);
|
||||
shape = shape.Moved(trsf2 * trsf1);
|
||||
return !shape.IsNull();
|
||||
}
|
||||
bool IfcGeom::convert(const Ifc2x3::IfcShapeRepresentation::ptr l, TopoDS_Shape& shape) {
|
||||
|
||||
@@ -111,7 +111,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcTrimmedCurve::ptr l, TopoDS_Wire& wire) {
|
||||
if ( i->is(Ifc2x3::Type::IfcCartesianPoint) && trim_cartesian ) {
|
||||
IfcGeom::convert(reinterpret_pointer_cast<IfcUtil::IfcAbstractSelect,Ifc2x3::IfcCartesianPoint>(i), pnt1 );
|
||||
trimmed1 = true;
|
||||
} else if ( i->is(Ifc2x3::Type::IfcParameterValue) ) {
|
||||
} else if ( i->is(Ifc2x3::Type::IfcParameterValue) && !trim_cartesian ) {
|
||||
const float value = *reinterpret_pointer_cast<IfcUtil::IfcAbstractSelect,IfcUtil::IfcArgumentSelect>(i)->wrappedValue();
|
||||
flt1 = value * parameterFactor;
|
||||
trimmed1 = true;
|
||||
@@ -125,12 +125,14 @@ bool IfcGeom::convert(const Ifc2x3::IfcTrimmedCurve::ptr l, TopoDS_Wire& wire) {
|
||||
BRepBuilderAPI_MakeEdge e (curve,pnt1,pnt2);
|
||||
w.Add(e.Edge());
|
||||
trimmed2 = true;
|
||||
} else if ( i->is(Ifc2x3::Type::IfcParameterValue) && trimmed1 ) {
|
||||
break;
|
||||
} else if ( i->is(Ifc2x3::Type::IfcParameterValue) && !trim_cartesian && trimmed1 ) {
|
||||
const float value = *reinterpret_pointer_cast<IfcUtil::IfcAbstractSelect,IfcUtil::IfcArgumentSelect>(i)->wrappedValue();
|
||||
float flt2 = value * parameterFactor;
|
||||
BRepBuilderAPI_MakeEdge e (curve,flt1,flt2);
|
||||
w.Add(e.Edge());
|
||||
trimmed2 = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( trimmed2 ) wire = w.Wire();
|
||||
|
||||
@@ -50,8 +50,8 @@ SHAPE(IfcMappedItem);
|
||||
SHAPE(IfcPolygonalBoundedHalfSpace);
|
||||
SHAPE(IfcHalfSpaceSolid);
|
||||
|
||||
FACE(IfcArbitraryClosedProfileDef);
|
||||
FACE(IfcArbitraryProfileDefWithVoids);
|
||||
FACE(IfcArbitraryClosedProfileDef);
|
||||
FACE(IfcRectangleProfileDef);
|
||||
FACE(IfcIShapeProfileDef);
|
||||
FACE(IfcCShapeProfileDef);
|
||||
|
||||
Reference in New Issue
Block a user