Skip to content

Commit

Permalink
Support degenerate tori with negative major radius
Browse files Browse the repository at this point in the history
This method already supported a degenerate torus with major radius > 0, with a cross-section that includes more than 1/2 of a circle, truncated by a chord across that circle.

This should now support a degenerate torus with major radius < 0, with a cross-section that includes less than 1/2 of a circle, also truncated by a chord across that circle.
  • Loading branch information
gonuke authored Jun 8, 2024
1 parent 7cfebdb commit 426f125
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions iGeom/iGeom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,16 +273,23 @@ void iGeom_createTorus(iGeom_Instance instance,
STRAIGHT_CURVE_TYPE, v1, v5);
profile_edges.insert(curve);

//the first arc
curve = GeometryModifyTool::instance()->make_RefEdge(ARC_CURVE_TYPE, v1,
v3, &v2_pos);
profile_edges.insert(curve);

//the second arc
curve = GeometryModifyTool::instance()->make_RefEdge(ARC_CURVE_TYPE, v3,
v5, &v4_pos);
profile_edges.insert(curve);

if (major_radius > 0) {
//the first arc
curve = GeometryModifyTool::instance()->make_RefEdge(ARC_CURVE_TYPE, v1,
v3, &v2_pos);
profile_edges.insert(curve);

//the second arc
curve = GeometryModifyTool::instance()->make_RefEdge(ARC_CURVE_TYPE, v3,
v5, &v4_pos);
profile_edges.insert(curve);
} else {
//only one arc
curve = GeometryModifyTool::instance()->make_RefEdge(ARC_CURVE_TYPE, v1,
v5, &v3_pos);
profile_edges.insert(curve);
}

// make surf from the curves
// This fails in Cubit
RefFace *surf = GeometryModifyTool::instance()->make_RefFace(
Expand Down

0 comments on commit 426f125

Please sign in to comment.