Enable writing wires, edges, and vertices inside compound in IGES in BREP mode.
Create IGES group for compound even if it contains single shape.
for (Ex.Init(start, TopAbs_WIRE, TopAbs_FACE); Ex.More(); Ex.Next()) {
TopoDS_Wire S = TopoDS::Wire(Ex.Current());
AddWarning(S," a Wire alone is not an IGESBRep entity : no Transfer");
for (Ex.Init(start, TopAbs_WIRE, TopAbs_FACE); Ex.More(); Ex.Next()) {
TopoDS_Wire S = TopoDS::Wire(Ex.Current());
AddWarning(S," a Wire alone is not an IGESBRep entity : no Transfer");
+
+ BRepToIGES_BRWire BW(*this);
+ BW.SetModel(GetModel());
+ IShape = BW.TransferWire(S);
+ if (!IShape.IsNull()) Seq->Append(IShape);
for (Ex.Init(start, TopAbs_EDGE, TopAbs_WIRE); Ex.More(); Ex.Next()) {
TopoDS_Edge S = TopoDS::Edge(Ex.Current());
AddWarning(S," a Edge alone is not an IGESBRep entity : no Transfer");
for (Ex.Init(start, TopAbs_EDGE, TopAbs_WIRE); Ex.More(); Ex.Next()) {
TopoDS_Edge S = TopoDS::Edge(Ex.Current());
AddWarning(S," a Edge alone is not an IGESBRep entity : no Transfer");
+
+ BRepToIGES_BRWire BW(*this);
+ BW.SetModel(GetModel());
+ IShape = BW.TransferEdge(S, Standard_False);
+ if (!IShape.IsNull()) Seq->Append(IShape);
for (Ex.Init(start, TopAbs_VERTEX, TopAbs_EDGE); Ex.More(); Ex.Next()) {
TopoDS_Vertex S = TopoDS::Vertex(Ex.Current());
AddWarning(S," a Vertex alone is not an IGESBRep entity : no Transfer");
for (Ex.Init(start, TopAbs_VERTEX, TopAbs_EDGE); Ex.More(); Ex.Next()) {
TopoDS_Vertex S = TopoDS::Vertex(Ex.Current());
AddWarning(S," a Vertex alone is not an IGESBRep entity : no Transfer");
+
+ BRepToIGES_BRWire BW(*this);
+ BW.SetModel(GetModel());
+ IShape = BW.TransferVertex(S);
+ if (!IShape.IsNull()) Seq->Append(IShape);
}
// construct the group
Standard_Integer nbshapes = Seq->Length();
}
// construct the group
Standard_Integer nbshapes = Seq->Length();
- Handle(IGESData_HArray1OfIGESEntity) Tab;
- if (nbshapes > 1) {
- Tab = new IGESData_HArray1OfIGESEntity(1,nbshapes);
+ if (nbshapes > 0) {
+ Handle(IGESData_HArray1OfIGESEntity) Tab =
+ new IGESData_HArray1OfIGESEntity(1,nbshapes);
for (Standard_Integer itab = 1; itab <= nbshapes; itab++) {
Handle(IGESData_IGESEntity) item = GetCasted(IGESData_IGESEntity, Seq->Value(itab));
Tab->SetValue(itab,item);
}
for (Standard_Integer itab = 1; itab <= nbshapes; itab++) {
Handle(IGESData_IGESEntity) item = GetCasted(IGESData_IGESEntity, Seq->Value(itab));
Tab->SetValue(itab,item);
}
- }
-
- if (nbshapes == 1) {
- res = IShape;
- }
- else if(nbshapes > 1) {
Handle(IGESBasic_Group) IGroup = new IGESBasic_Group;
IGroup->Init(Tab);
res = IGroup;
Handle(IGESBasic_Group) IGroup = new IGESBasic_Group;
IGroup->Init(Tab);
res = IGroup;
SetShapeResult ( start, res );
SetShapeResult ( start, res );
set EntityList {VERTEX EDGE WIRE FACE SHELL SOLID COMPSOLID COMPOUND SHAPE}
set EntityList {VERTEX EDGE WIRE FACE SHELL SOLID COMPSOLID COMPOUND SHAPE}
+ puts "Checking $message"
foreach Entity ${EntityList} {
set expr_string "${Entity} +: +(\[-0-9.+eE\]+)"
if { [regexp "${expr_string}" ${nbshapes_expected_s} full nb_entity1] > 0 } {
if { [regexp "${expr_string}" ${nb_info} full nb_entity2] > 0 } {
if { ${nb_entity2} != ${nb_entity1} } {
foreach Entity ${EntityList} {
set expr_string "${Entity} +: +(\[-0-9.+eE\]+)"
if { [regexp "${expr_string}" ${nbshapes_expected_s} full nb_entity1] > 0 } {
if { [regexp "${expr_string}" ${nb_info} full nb_entity2] > 0 } {
if { ${nb_entity2} != ${nb_entity1} } {
- puts "Error : ${message} is WRONG because number of ${Entity} entities is ${nb_entity2} while ${nb_entity1} is expected"
+ puts "Error: number of ${Entity} entities is wrong: ${nb_entity2} while ${nb_entity1} is expected"
- puts "OK : ${message} is GOOD because number of ${Entity} entities is equal to number of expected ${Entity} entities"
+ puts "OK: number of ${Entity} entities is as expected: ${nb_entity2}"
--- /dev/null
+# Test issue #25816: writing edges inside compound to IGES 5.3
+
+pload MODELING DATAEXCHANGE
+
+# make compound containing one edge
+circle c 0 0 0 0 0 1 1
+mkedge e c
+compound e s
+
+# write to IGES in BREP mode
+newmodel
+param write.iges.brep.mode 1
+brepiges s ${imagedir}/${casename}.igs
+
+# read back and check similarity
+igesbrep ${imagedir}/${casename}.igs a *
+checknbshapes a [nbshapes s] t "Number of sub-shapes in result after saving to IGES and reading back"