Custom Texture Mapping Logic

Does anyone know how exactly the custom texture mapping in Rhino maps the UV coordinates from the reference surface to the target surface? Does it use closest point or normals or something else?

Yes. I know. I can’t tell if you’re a developer or a user, but I’m going to guess developer…so here’s the technical stuff from the C++ SDK:

Projection:

When a mapping primitive, like a plane, sphere, box, or cylinder, is used, there are two projection options.

clspt_projection: world xyz maps to the point on the mapping primitive that is closest to xyz. In this case, ON_TextureMapping::Evaluate ignores the vector argument.

ray_projection: world xyz + world vector defines a world line. The world line is intersected with the mapping primitive and the intersection point that is closest to the world xyz point is used to calculate the mapping parameters.

The value of m_projection can be changed as needed.

If m_type = srfp_mapping, then m_projection is ignored.

Hi Andy thanks much for the response.

I am familiar with rhinocommon but I have had no experience with the c++ sdk up until now so having a hard time finding what I need. My .net plugin is doing geometry projections that should mimic custom texture mapping as accurately as possible, but I am not actually doing any texture mapping.

Is there an online reference for the c++ sdk similar to http://4.rhino3d.com/5/rhinocommon/ or do I need to install the sdk to see the documentation?

You need to install the SDK I think.

got it, thanks again.