mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-27 19:01:02 +00:00
Rib: accept a Project feature as its sketch ref
Rib guarded with `sk.type != CadFeatureType::Sketch`, while every other sketch consumer — Extrude, SurfaceExtrude, SurfaceRevolve, the loft paths — tests `!= Sketch && != Project`. A Project feature carries a plane and Line entities, which is all a rib reads, so the guard blocked "project a body edge, then rib along it" for no stated reason. The picker in the Design tab offered Sketch features only, so it is widened to match: a kernel that accepts Project refs and a GUI that never lists them would have left the path unreachable anyway. Worth recording for whoever hits this next: Rib also needs a sketch carrying EXPLICIT entities. A parametric Rectangle sketch (add_sketch with width/height) has an empty entities vector — build_sketch_wire synthesises its profile on demand — so rib_entity 0 is out of range there and it fails with "rib: bad entity". That is why Rib could not be driven headlessly at all before this change; a Project feature is now the one programmatic way to produce a ribbable line. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
1cb80f7f9f
commit
b25335e1b3
@@ -2273,7 +2273,10 @@ void CadDocument::apply_feature(TopoDS_Shape& result, bool& have_body,
|
||||
if (f.rib_sketch_ref < 0 || f.rib_sketch_ref >= (int)features.size())
|
||||
throw std::runtime_error("rib: bad sketch ref");
|
||||
const CadFeature& sk = features[f.rib_sketch_ref];
|
||||
if (sk.type != CadFeatureType::Sketch)
|
||||
// Project counts as sketch-like here exactly as it does for Extrude, SurfaceExtrude
|
||||
// and SurfaceRevolve: it carries plane + Line entities, which is all a rib reads.
|
||||
// Ribbing along a projected body edge is otherwise unreachable.
|
||||
if (sk.type != CadFeatureType::Sketch && sk.type != CadFeatureType::Project)
|
||||
throw std::runtime_error("rib: ref is not a sketch");
|
||||
if (f.rib_entity < 0 || f.rib_entity >= (int)sk.entities.size())
|
||||
throw std::runtime_error("rib: bad entity");
|
||||
|
||||
Reference in New Issue
Block a user