I am fairly new to WPF, and the 3D environment. I made an app, in which I imported a quite big 3D model .obj file. Rendering it, takes between 1 to 2 minutes, meaning that the model itself has a large number of faces/triangles,as it is a solid model. Is there a way in which I can impor the obj file and I can convert it/render it as a surface model?
Thanks in advance!
This is my code :
ModelImporter importer = new ModelImporter();
System.Windows.Media.Media3D.Material material = new DiffuseMaterial(new SolidColorBrush(Colors.Beige));
importer.DefaultMaterial = material;
mymodels = new Model3DGroup();
Part1 = importer.Load("3dmodels\\*****.obj");
mymodels.Children.Add(Part1);
this.Our_Model = mymodels;
obj files are surface models. meaning made up of triangle/quadrangle/etc... i don't think there are tetras/hexas/etc in this format. Anyway, if you have avolumic object and want to render "only" the surface as triangles/quads... you'll need a little bit of work, here is how i do it for tetras:
First decompose your tetras :
then register the face adjacency in a Dictionary<string, Triangle>:
where GetKeyCombinations() returns the permutations of indices. and if a face is already registered nullify the face (meaning that this face has an adjacency -> is not on the surface)
finally create your mesh :
You may need to adapt "CreateVisibleMesh" to fit Helix requirement (adding vertices and indices correctly).
This is not necessarilly the most efficient way to go (permutations and stuff) but it does the job. Finally just for helping you :