mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
#1649 allow profile def in create shape()
This commit is contained in:
@@ -30,7 +30,11 @@ bool IfcGeom::Kernel::convert_shapes(const IfcBaseClass* l, IfcRepresentationSha
|
||||
if (shape_type(l) != ST_SHAPELIST) {
|
||||
TopoDS_Shape shp;
|
||||
if (convert_shape(l, shp)) {
|
||||
r.push_back(IfcGeom::IfcRepresentationShapeItem(l->data().id(), shp, get_style(l->as<IfcSchema::IfcRepresentationItem>())));
|
||||
const IfcGeom::SurfaceStyle* style = nullptr;
|
||||
if (l->as<IfcSchema::IfcRepresentationItem>()) {
|
||||
style = get_style(l->as<IfcSchema::IfcRepresentationItem>());
|
||||
}
|
||||
r.push_back(IfcGeom::IfcRepresentationShapeItem(l->data().id(), shp, style));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -446,7 +446,11 @@ struct ShapeRTTI : public boost::static_visitor<PyObject*>
|
||||
}
|
||||
} else {
|
||||
if (!representation) {
|
||||
if (instance->declaration().is(Schema::IfcRepresentationItem::Class()) || instance->declaration().is(Schema::IfcRepresentation::Class())) {
|
||||
if (instance->declaration().is(Schema::IfcRepresentationItem::Class()) ||
|
||||
instance->declaration().is(Schema::IfcRepresentation::Class()) ||
|
||||
// https://github.com/IfcOpenShell/IfcOpenShell/issues/1649
|
||||
instance->declaration().is(Schema::IfcProfileDef::Class())
|
||||
) {
|
||||
IfcGeom::IfcRepresentationShapeItems shapes = kernel.convert(instance);
|
||||
|
||||
IfcGeom::ElementSettings element_settings(settings, kernel.getValue(IfcGeom::Kernel::GV_LENGTH_UNIT), instance->declaration().name());
|
||||
|
||||
Reference in New Issue
Block a user