Posts: 731
Threads: 8
Joined: Sep 2009
Reputation:
35
Some of the required functionality is available with the Ab3d.PowerToys library, but some will need to be implemented by yourself by changing the posiitons of the mesh:
1)
You can import stl files by using Assimp importer - see the Ab3d.PowerToys samples the "Assimp imporer / exporter" - "Assimp model viewer" sample. You can also start the sample and drag and drop stl file to the sample to see how the file is imported.
2)
The is no functionality to inflate the mesh. I am also not familiar with that alogorithm. But after importing the stl file you get a GemetryModel3D or Model3DGroup (the Model3DGroup can contain multiple GeometryModel3D objecst). Each GeometryModel3D object has a Geometry property that is set to a MeshGeometry3D object. This object defines Positions, Normals, TextureCoordinates and TriangleIndices. You can change that data to inflate the mesh. If you want to just apply a transformation to a mesh (update mesh positions, then you can use the Ab3d.Utilities.MeshUtils.TransformMeshGeometry3D method.
3)
To flatten to mesh at the top and bottom you will also need to manually update the positions of the mesh. I do not know details about how you want to do that, but one way is to go through all the Positions and if the positions's y value (in WPF 3d coordinate system y is up direction) is bigger then some value, then this position is considered to be top positions and in this case its value is changed to some fixed y value (so all positions bigger then some value will get the same y value). The same is done for bottom values.
4)
You can easily invert normals by multiplying them by -1. You can also use the Ab3d.Utilities.MeshUtils.FlipNormals method to do that. To add one mesh to another you can use the Ab3d.Utilities.MeshUtils.CombineMeshes method.
5)
See two Boolean operations samples in the "Advanced 3D objects" section of the Ab3d.PowerToys samples. Note that the Boolena opertion can significantly increase the number of positions on the generated mesh - so try to keep the number of segments for the cylinders as low as possible. To get a mesh for cylinder you can use: Ab3d.Meshes.CylinderMesh3D class.
6)
With Ab3d.PowerToys you can split the mesh by a 3D plane and get the split line. See the "Advanced 3D objects" / "Slice 3D model with a plane" sample for more info.
When manually changing the mesh positions it may be useful to visually see the numbers of positions and number of triangles. To do that you can use the MeshInspectorOverlay - see the "Utilities" / "MeshInspectorOverlay" sample for more info.
Andrej Benedik