How sim.getShapeMesh works?
Posted: 20 Feb 2021, 10:14
Hello,
My goal is to retrieve the orientation and position of normal to every surface on a shape, and I'm pretty sure the API needed is sim.getShapeMesh, but not sure how it works.
For example, for a pure shape cuboid, it gives me normals like below:
{0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0}
but why are there so many values while the cuboid only has 6 surfaces? Thought it should be only 6 normals?
Do they represent orientations of the normals? Then how may I get the position of every normal (Like at the center of mass in every surface)?
Excuse for my poor presentation, thank u.
My goal is to retrieve the orientation and position of normal to every surface on a shape, and I'm pretty sure the API needed is sim.getShapeMesh, but not sure how it works.
For example, for a pure shape cuboid, it gives me normals like below:
{0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0}
but why are there so many values while the cuboid only has 6 surfaces? Thought it should be only 6 normals?
Do they represent orientations of the normals? Then how may I get the position of every normal (Like at the center of mass in every surface)?
Excuse for my poor presentation, thank u.