chore: Add debug logging for sketch face creation
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
@@ -17,6 +17,7 @@
|
|||||||
#include <gp_Pln.hxx>
|
#include <gp_Pln.hxx>
|
||||||
|
|
||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
SketchFeature::SketchFeature(const QString& name)
|
SketchFeature::SketchFeature(const QString& name)
|
||||||
: Feature(name)
|
: Feature(name)
|
||||||
@@ -122,6 +123,7 @@ void SketchFeature::buildShape()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!lineEdges.isEmpty()) {
|
if (!lineEdges.isEmpty()) {
|
||||||
|
qDebug() << "buildShape: processing" << lineEdges.size() << "line edges";
|
||||||
TopoDS_Compound compound;
|
TopoDS_Compound compound;
|
||||||
BRep_Builder builder;
|
BRep_Builder builder;
|
||||||
builder.MakeCompound(compound);
|
builder.MakeCompound(compound);
|
||||||
@@ -132,16 +134,24 @@ void SketchFeature::buildShape()
|
|||||||
ShapeAnalysis_FreeBounds freeBounds(compound, 1e-6, Standard_True);
|
ShapeAnalysis_FreeBounds freeBounds(compound, 1e-6, Standard_True);
|
||||||
TopoDS_Compound closedWires = freeBounds.GetClosedWires();
|
TopoDS_Compound closedWires = freeBounds.GetClosedWires();
|
||||||
|
|
||||||
|
if (closedWires.IsNull()) {
|
||||||
|
qDebug() << "buildShape: no closed wires found";
|
||||||
|
}
|
||||||
|
|
||||||
TopExp_Explorer explorer(closedWires, TopAbs_WIRE);
|
TopExp_Explorer explorer(closedWires, TopAbs_WIRE);
|
||||||
for (; explorer.More(); explorer.Next()) {
|
for (; explorer.More(); explorer.Next()) {
|
||||||
TopoDS_Wire wire = TopoDS::Wire(explorer.Current());
|
TopoDS_Wire wire = TopoDS::Wire(explorer.Current());
|
||||||
BRepBuilderAPI_MakeFace faceBuilder(wire);
|
BRepBuilderAPI_MakeFace faceBuilder(wire);
|
||||||
if (faceBuilder.IsDone()) {
|
if (faceBuilder.IsDone()) {
|
||||||
faces.append(faceBuilder.Face());
|
faces.append(faceBuilder.Face());
|
||||||
|
qDebug() << "buildShape: face created from wire";
|
||||||
|
} else {
|
||||||
|
qDebug() << "buildShape: face creation from wire FAILED";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qDebug() << "buildShape: total faces created:" << faces.size();
|
||||||
if (faces.isEmpty()) {
|
if (faces.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user