THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 08/11/2009 at 06:44, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 10
Platform: Windows ; Mac OSX ;
Language(s) : C++ ;
---------
Hi,
I want to iterate over all segments of a spline and retrieve the length of each segment. It seems GetSegmentLength() would be the function to use, but I get stupid results. Maybe it's not documented correctly.
Here's the code:
// Iterate Segments, treat each segment like a separate spline (as in the old function)
for (s = C_ZERO; s < SegmentCount; s++)
{
// Get this segment's length
ThisSegmentLength = sp->GetSegmentLength(s, s+1);
GePrint("Segment " + LongToString(s) + ": " + RealToString(ThisSegmentLength) + " units.");
}
So what are those two parameter that I have to pass to GetSegmentLength()? In the documentation it sais:
Parameters
LONG a
Start segment.LONG b
End segment.
But that doesn't seem to be correct. For example, my spline only has one segment, and a total length of some hundred units. But GetSegmentLength() returns a length of only 0.134 units, which is definitely wrong. And if I pass the same segment index to a and b, the returned length is always zero.
Are a and b rather point indexes instead of segments?
Thanks for any tipps!
Greetings,
Jack