I wish to "create" an arc from an ellipse. I have the fractions of the ellipse that I wish to clone between. However, I have a case where I need the portion of the ellipse that lies across the "end" (fraction =1.0) and extends to where the fraction is > 0.0. For example, I wish to clone the portion of the ellipse from the fraction 0.85 to 0.125. My attempts with
ellipse->CloneBetweenCyclicIndexedFractions(0, 0.85, 0, 0.125);
will return the portion from 0.125 to 0.85 and NOT the section from 0.85 to 0.125. Is it possible to return (i.e. Clone) across the start/end of an ellipse? I tried to clone two CurveVectors (0.0 to 0.125 and 0.85 to 1.0) then "Add()" them, but my tool immediately crashes:
CurveVectorPtr Arc = ellipse->CloneBetweenCyclicIndexedFractions(0, 0.0, 0, 0.125); CurveVectorPtr Arc2 = ellipse->CloneBetweenCyclicIndexedFractions(0, 0.85, 0, 1.0); Arc->Add(Arc2); // crashes here creating the EditElementHandle DraftingElementSchema::ToElement(eehArc, *Arc, nullptr, ACTIVEMODEL->Is3d(), *ACTIVEMODEL);
Hi Bruce,
I believe you may need to add an ICurvePathEdit similar to: examples\Elements\exampletool\ExampleModifyTool.cpp (See lines:112 and 116) when creating the new element.
Bob
Try this:
ellipse->CloneBetweenCyclicIndexedFractions(0, 0.85, 1, 0.125);
The index values are treated cyclically, so passing a value of 1 for the 2nd index defines the direction and will make it wrap.
HTH
-B
* CurveVector::ConsolidateAdjacentPrimitives will combine adjacent/compatible arcs into a single arc...