Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey there,
i am actually looking for a way to get holes in a 3D-quader.
To create and display the quader i use the helix wpf based toolkit.
C#
meshBuilder.AddBox(new Rect3D(new Point3D(min.X, min.Y, min.Z), new Size3D(dim.X, dim.Y, dim.Z)));

Now i want to create a more complexe model. Therefore i searched for a way to use "constructive solid geometry".
https://en.wikipedia.org/wiki/Constructive_solid_geometry[^]

But i can't find any working solution. I guess if i wan't to use complexe models in helix-toolkit i have to build them in some other programm and import them. Is that right?

I appreciate any kind of help :)
Greetings 3DC#
Posted

Hi I'm afraid meshBuilder will not help you with this. For CSG you will need Boolean operations but there are none, so you will have to either use something else or do it old way face by face. In this case you can probably use only triangle mesh and that's quite easy (no special cases). Hint: Draw it on the paper, divide faces to triangles... :D
Good luck
 
Share this answer
 
Comments
3DC# 22-Jul-15 4:50am    
Hey yado,

thanks for your answer. Damn - so not as easy as i thought :P. The problem is, that in my case it is really dynamic. I import informations from xml to design the object and it's content. The object is (as example) a side and its content are (as example) 20 drills. Actually i add for each content a new GeometryModel3D to a Model3DGroup. But it would look so much better with real holes in the main object. Isn't it pretty complexte to do it with triangle mesh?
Not really - your graphic card have to do the same thing every time it renders something... ;)
 
Share this answer
 
Hey there,

tried to get it done with the triangle mesh. But i failed again.

As i said i want to combine multiple cylinders with one rectangle.
First i collect all points of the cylinders. Therefore i add the new cylinders in a loop to the builder and save the calculated positions in an array
C#
insideMeshBuilder.AddCylinder(
                    new Point3D(drillPartMin.X, drillPartMin.Y, drillPartMin.Z),
                    new Point3D(drillPartMax.X, drillPartMax.Y, drillPartMax.Z),
                    unitTask.Information.Diameter,
                    ThetaDiv);
List<point3d> combinedPoints = new List<point3d>();

foreach (Point3D point in insideMeshBuilder.Positions)
{
  combinedPoints.Add(point);
}
</point3d></point3d>

In the second step i add the points of the cube to that collection.
C#
meshBuilder.AddBox(new Rect3D(new Point3D(min.X, min.Y, min.Z), new Size3D(dim.X, dim.Y, dim.Z)));
List<point3d> combinedPoints = new List<point3d>();
foreach (Point3D point in meshBuilder.Positions)
{
   combinedPoints.Add(point); 
}
</point3d></point3d>

Now i have all points which i need to define the modell. I don't know how to connect these points to build a visual surface. I guess i need some sort of triangulation? Or is there a meshBuilder method to build models only by a point cloud?
Thanks for your help! =)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900