mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-23 07:32:42 +00:00
@@ -1253,21 +1253,42 @@ namespace {
|
|||||||
|
|
||||||
// @todo make this generic for other sweeps not just swept disk
|
// @todo make this generic for other sweeps not just swept disk
|
||||||
void process_sweep(const TopoDS_Wire& wire, double radius, TopoDS_Shape& result) {
|
void process_sweep(const TopoDS_Wire& wire, double radius, TopoDS_Shape& result) {
|
||||||
gp_Ax2 directrix;
|
std::vector<TopoDS_Wire> wires;
|
||||||
if (!wire_to_ax(wire, directrix)) {
|
segment_adjacent_non_linear(wire, wires);
|
||||||
return;
|
|
||||||
|
TopoDS_Compound C;
|
||||||
|
BRep_Builder B;
|
||||||
|
if (wires.size() > 1) {
|
||||||
|
B.MakeCompound(C);
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle(Geom_Circle) circle = new Geom_Circle(directrix, radius);
|
for (auto& w : wires) {
|
||||||
TopoDS_Wire section = BRepBuilderAPI_MakeWire(BRepBuilderAPI_MakeEdge(circle));
|
TopoDS_Shape part;
|
||||||
if (is_single_circular_edge(wire)) {
|
|
||||||
process_sweep_as_revolution(wire, section, result);
|
gp_Ax2 directrix;
|
||||||
} else if (is_single_linear_edge(wire)) {
|
if (!wire_to_ax(w, directrix)) {
|
||||||
process_sweep_as_extrusion(wire, section, result);
|
continue;
|
||||||
} else {
|
}
|
||||||
process_sweep_as_pipe(wire, section, result);
|
Handle(Geom_Circle) circle = new Geom_Circle(directrix, radius);
|
||||||
}
|
TopoDS_Wire section = BRepBuilderAPI_MakeWire(BRepBuilderAPI_MakeEdge(circle));
|
||||||
return;
|
|
||||||
|
if (is_single_circular_edge(w)) {
|
||||||
|
process_sweep_as_revolution(w, section, part);
|
||||||
|
} else if (is_single_linear_edge(w)) {
|
||||||
|
process_sweep_as_extrusion(w, section, part);
|
||||||
|
} else {
|
||||||
|
process_sweep_as_pipe(w, section, part);
|
||||||
|
}
|
||||||
|
if (wires.size() > 1) {
|
||||||
|
B.Add(C, part);
|
||||||
|
} else {
|
||||||
|
result = part;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (wires.size() > 1) {
|
||||||
|
result = C;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// Eliminate Swept Surfaces?
|
// Eliminate Swept Surfaces?
|
||||||
@@ -1291,46 +1312,6 @@ namespace {
|
|||||||
}
|
}
|
||||||
result = sbrs.Apply(result);
|
result = sbrs.Apply(result);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
// This code is no longer active, as with the BRepBuilderAPI_Transformed
|
|
||||||
// transitioning mode on the pipe, issues no longer seem to occur.
|
|
||||||
|
|
||||||
std::vector<TopoDS_Wire> wires;
|
|
||||||
segment_adjacent_non_linear(wire, wires);
|
|
||||||
|
|
||||||
TopoDS_Compound C;
|
|
||||||
BRep_Builder B;
|
|
||||||
if (wires.size() > 1) {
|
|
||||||
B.MakeCompound(C);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (auto& w : wires) {
|
|
||||||
TopoDS_Shape part;
|
|
||||||
|
|
||||||
gp_Ax2 directrix;
|
|
||||||
if (!wire_to_ax(w, directrix)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
Handle(Geom_Circle) circle = new Geom_Circle(directrix, radius);
|
|
||||||
TopoDS_Wire section = BRepBuilderAPI_MakeWire(BRepBuilderAPI_MakeEdge(circle));
|
|
||||||
|
|
||||||
if (is_single_linear_edge(w)) {
|
|
||||||
process_sweep_as_extrusion(w, section, part);
|
|
||||||
} else {
|
|
||||||
process_sweep_as_pipe(w, section, part);
|
|
||||||
}
|
|
||||||
if (wires.size() > 1) {
|
|
||||||
B.Add(C, part);
|
|
||||||
} else {
|
|
||||||
result = part;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (wires.size() > 1) {
|
|
||||||
result = C;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user