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