I am familiar with the RenderMan API, I am interested in what sort of transformation was constructed and applied to the CV data from the OpenNURBS library before they are submitted to the RiTrimCurve call, this will help me understand what is going on.
In the above example, using the first value as a comparison
CV[0].x is 13.4977 from the OpenNURBS library retrieval call
CV[0].x is 0.768786 is supplied to the RtFloat u[] parameter in the call to RiTrimCurve
Using the example file v5_my_trimmed_surface.3dm OpenNURBS’s examples, from dumping out the trim curve CV, I see values like (there are 3 curves use for trimming)
Yes, I am attempting to get the information from m_C2, maybe the way I retrieve the m_C2 is incorrect and as such, don’t get the parametric value and some other values instead, here is the code as it currently is
If I’m not mistaken it is possible for a 2d trim curve to be reversed in parameter space w.r.t. the 3d curve it represents. I think, for example, on an untrimmed surface, that the boundary curves are in the same direction (clockwise or anti-clockwise), whereas the north- and south 2d trim curves are “parallel” and the east and west 2d trim curves too.
The public boolean member variable for this can be found on the corresponding ON_Trim object, and is called m_bRev3d.
Take a look and see if that can explain what you are seeing.
Before writing a Brep, the RIB exporter changes the parameterization of each face:
ON_Interval udom, vdom;
udom.Set(0.0, 1.0);
vdom.Set(0.0, 1.0);
for (int fi = 0; fi < pBrep->m_F.Count(); fi++)
{
ON_BrepFace* pF = pBrep->Face(fi);
if (pF)
{
// This changes the parameterization of the face's surface and transforms
// the "u" and "v" coordinates of all the face's parameter space trimming
// curves. The locus of the face is not changed.
pF->SetDomain(udom, vdom);
}
}