Develops new 3D importer with SDK 6.0
Hello,<div>I want to make a new RS add-in that can import a PLY file format.</div><div>I have an external dll that can import this file format, but I don't know how to represents this ( vertices, faces, normals, material, ecc) with SDK internal geometry.</div><div><span style="font-size: 10pt;">There are some internal tutorial that show this?</span><span style="font-size: 10pt;"> </span></div>
0
Comments
-
<p>Hi, here is some sample code that creates a Part with a mesh consisting of a single flat Surface:</p>
Part BuildPart()
{
// Create a face
var meshFace = new MeshFace();
meshFace.Material = new Material(System.Drawing.Color.Azure);
// Add vertices and normals
meshFace.Vertices.Add(new Vector3(0, 0, 0));
meshFace.Vertices.Add(new Vector3(1, 0, 0));
meshFace.Vertices.Add(new Vector3(0, 1, 0));
meshFace.Vertices.Add(new Vector3(1, 1, 0));
meshFace.Normals.Add(new Vector3(0, 0, 1));
meshFace.Normals.Add(new Vector3(0, 0, 1));
meshFace.Normals.Add(new Vector3(0, 0, 1));
meshFace.Normals.Add(new Vector3(0, 0, 1));
// Add triangles
meshFace.TriangleIndices.AddRange(new int[] { 0, 1, 2, 2, 1, 3 });
// Add wireframe
meshFace.WireIndices.AddRange(new int[] { 1, 0, 2, -1, 0, 3, 2, 1 });
// Add the face to a body
var meshBody = new MeshBody();
meshBody.Faces.Add(meshFace);
// Add the body to a part
var meshPart = new MeshPart();
meshPart.Bodies.Add(meshBody);
// Assign the part
Part part = new Part(false);
part.Mesh[DetailLevels.Medium] = meshPart;
// Call Rebuild() to commit the data to the graphics system
part.Mesh.Rebuild();
return part;
}
Johannes Weiman
Software Engineer
RobotStudio Team, ABB Robotics0 -
Thank you very match.<div><br></div><div>Just another questions..</div><div><br></div><div>Where I can enable or disable material culling?</div><div><br></div><div><br></div>0
-
If you mean backface culling, it is enabled by default and you can disable it by setting a flag on each MeshFace:
meshFace.Flags = MeshFlags.DisableBackFaceCullJohannes Weiman
Software Engineer
RobotStudio Team, ABB Robotics0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 310 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings