Skip to content

Commit

Permalink
Parameterization should match the length of a curve
Browse files Browse the repository at this point in the history
  • Loading branch information
dalefugier committed Nov 15, 2024
1 parent 2a22322 commit 92c75f4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rhinocommon/cs/SampleCsCommands/SampleCsAddNurbsCircle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ protected override Result RunCommand(RhinoDoc doc, RunMode mode)

if (curve.IsValid)
{
var length = curve.GetLength();
var domain = new Interval(0.0, length);
curve.Domain = domain;

doc.Objects.AddCurve(curve);
doc.Views.Redraw();
}
Expand Down
5 changes: 5 additions & 0 deletions rhinocommon/cs/SampleCsCommands/SampleCsAddNurbsCurve.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ protected override Result RunCommand(RhinoDoc doc, RunMode mode)

if (curve.IsValid)
{
// Parameterization should match the length of a curve
var length = curve.GetLength();
var domain = new Interval(0.0, length);
curve.Domain = domain;

doc.Objects.AddCurve(curve);
doc.Views.Redraw();
}
Expand Down
5 changes: 5 additions & 0 deletions rhinocommon/cs/SampleCsCommands/SampleCsNurbsCircle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ protected override Result RunCommand(RhinoDoc doc, RunMode mode)

if (curve.IsValid)
{
// Parameterization should match the length of a curve
var length = curve.GetLength();
var domain = new Interval(0.0, length);
curve.Domain = domain;

doc.Objects.AddCurve(curve);
doc.Views.Redraw();
}
Expand Down

0 comments on commit 92c75f4

Please sign in to comment.