Exemple #1
0
bool IfcGeom::Kernel::convert(const IfcSchema::IfcCurveBoundedPlane* l, TopoDS_Shape& face) {
    gp_Pln pln;
    IfcGeom::Kernel::convert(l->BasisSurface(), pln);

    gp_Trsf trsf;
    trsf.SetTransformation(pln.Position(), gp::XOY());

    TopoDS_Wire outer;
    convert_wire(l->OuterBoundary(), outer);

    BRepBuilderAPI_MakeFace mf (outer);
    mf.Add(outer);

    IfcSchema::IfcCurve::list::ptr inner = l->InnerBoundaries();

    for (IfcSchema::IfcCurve::list::it it = inner->begin(); it != inner->end(); ++it) {
        TopoDS_Wire inner;
        convert_wire(*it, inner);

        mf.Add(inner);
    }

    ShapeFix_Shape sfs(mf.Face());
    sfs.Perform();
    face = TopoDS::Face(sfs.Shape()).Moved(trsf);

    return true;
}
Exemple #2
0
bool IfcGeom::Kernel::convert(const IfcSchema::IfcArbitraryProfileDefWithVoids* l, TopoDS_Shape& face) {
	TopoDS_Wire profile;
	if ( ! convert_wire(l->OuterCurve(),profile) ) return false;
	BRepBuilderAPI_MakeFace mf(profile);
	IfcSchema::IfcCurve::list::ptr voids = l->InnerCurves();
	for( IfcSchema::IfcCurve::list::it it = voids->begin(); it != voids->end(); ++ it ) {
		TopoDS_Wire hole;
		if ( convert_wire(*it,hole) ) {
			mf.Add(hole);
		}
	}
	ShapeFix_Shape sfs(mf.Face());
	sfs.Perform();
	face = TopoDS::Face(sfs.Shape());
	return true;
}