The question of ON_SquishMesh


#1

Hi Dale:
I’m trying to write 3D surfaces and curves on the surface can be flattened in a 2D plane and the opposite process.I try to use the SDK inside ON_SquishMesh(), I wrote the following code:

ON_SquishParameters * sp = new ON_SquishParameters();
sp-> SetSpringConstants (1.0, 1.0);
sp-> m_bSaveMapping = true;
sp-> m_bAreaPreprocess = true;
sp-> m_material = 1;

ON_SquishConstraints * sc = new ON_SquishConstraints();
Srf0-> CreateMesh (mp, m_meshAry);
ON_Mesh * outMesh1 = new ON_Mesh();
ON_Mesh * outMesh2 = new ON_Mesh();
outMesh1 = ON_SquishMesh (m_meshAry [0], sp, sc, outMesh2);

I have some questions to ask.

(I) What is the difference, “outMesh1” and “outMesh2”? In accordance with the Help file says, outMesh2 is to be variable input, I put a “outMesh2” into function, but found “outMesh1” and “outMesh2” will become the same.

(II) The second parameter ON_SquishParameters, m_bSaveMapping variables within this Class in SDK Help instructions for 『If m_bEnableMapBack is true, then ON_SquishMesh () will save extra information on the squished mesh so 3d points and curves near the input mesh can be mapped to the squished mesh and …』derived here are two small problems:
(a) I can not find “m_bEnableMapBack” in the SDK Help. It really exist?
(b) see the instructions say: 3D points and curves near the input mesh can be mapped to the squished mesh and『 2d points and curves on the squished mesh can be mapped back to the 3d mesh.』Are there examples in bold part?


(Dale Fugier) #2

If you provide a “outMesh2” parameter, then its m_P[] array will be used to set the vertex locations of the result. I believe the Squish command does not specify this parameter (passes a NULL value).

I believe it exists. But is not exposed in the Rhino SDK. In fact, ON_SquishMesh is part of a larger set of tools which are not exposed in the Rhino SDK.

Again, not all of the squishing tools are exposed in the Rhino SDK. So there is no way, using the Rhino SDK and ON_SquishMesh, to do this - sorry.

@dalelear feel free to chime in.


#3

Hi dale, thanks for your answer. Will ON_SquishMesh be exposed in Rhino v6?


(Kelvin Cheng) #4

Hi tielsc,

The request has been added to the Rhino wish list.

http://mcneel.myjetbrains.com/youtrack/issue/RH-29249

Hope Dale Lear can expose all the Squish tools in Rhino 6 SDK.

Thanks,

  • Kelvin

(Willem Derks) #5

Hi Kelvin, @dalelear,

I’m revisiting this topic to check on what to expect for squish and V6. I’m currently scripting the command but would love to get a better workflow by having squish -and it’s settings- exposed via rhinocommon.

On a practical note: For the current Squish command what are the parameters used to create the mesh for flattening from a surface? There seems to be a hardcoded meshing parameters (regardless of the document or object custom mesh settings) Is that correct or am I missing something?

Thanks
-Willem


(Dale Fugier) #6

Hi Willem,

I don’t expect there to be any changes to the Squish command or API for the initial release of V6. SDK improvements are something we can provide in a service release.

– Dale