Which 3D model format contains all planes information? - cad

I need to extract all planes information(position, size, rotation) of 3d model in my own defined coordinate.
The model maybe given as .STEP, or any other CAD supported file.
I'm pretty familiar with 3d graphics, but it's my first time to deal with CAD file.
Is there any 3d file format having an advantage for handling all planes? If so, I would like to convert .STEP file to it.
Any helps?

Related

how to convert the 2d image into 3d object file using vtk

how to convert the image into object file like as .obj or .ply . I need some code written in visualization toolkit and c++.
Thanks
Image data is pixel data and .obj/ .ply or for that matter .stl is 3D geometry data with Point and Cell (for .obj Cell is Triangle) information.
Your question is not clear, but to give you some steps -
First, you need to identify how would you convert the pixels into points? vtkImageDataGeometryFilter might be of help here. Although it might not be sufficient as you will also need triangles data.
Once you get vtkPolyData from image data, you can write this data to STL or OBJ or PLY format. You can use following VTK classes for that
vtkSTLWriter, vtkOBJWriter and vtkPLYWriter.

VTK - create 3D model

I'm trying to create a 3D mask model from the 3D coordinate points that are stored in the txt file. I use the Marching cubes algorithm. It looks like it´s not able to link individual points, and therefore holes are created in the model.
Steps: (by https://lorensen.github.io/VTKExamples/site/Cxx/Modelling/MarchingCubes/)
First, load 3D points from file as vtkPolyData.
Then, use vtkVoxelModeller
Put voxelModeller output to MC algorithm and finally visualize
visualization
Any ideas?
Thanks
The example takes a spherical mesh (a.k.a. a set of triangles forming a sealed 3D shape), converts it to a voxel representation (a 3D image where the voxels outside the mesh are black and those inside are not) then converts it back to a mesh using Marching Cubes algorithm. In practice the input and output of the example are very similar meshes.
In your case, you load the points and try to create a voxel representation of them. The problem is that your set of points is not sufficient to define a volume, they are not a sealed mesh, just a list of points.
In order to replicate the example you should do the following:
1) building a 3D mesh from your points (you gave no information of what the points are/represent so I can't help you much with this task). In other words you need to tell how these points are connected between then to form a 3D shape (vtkPolyData). VTK can't guess how your points are connected, you have to tell it.
2) once you have a mesh, if you need a voxel representation (vtkImageData) of it you can use vtkVoxelModeller or vtkImplicitModeller. At this point you can use vtk filters that need a vtkImageData as input.
3) finally in order to convert voxels back to a mesh (vtkPolyData) you can use vtkMarchingCubes (or better vtkFlyingEdges3D that is a very similar algorithm but much faster).
Edit:
It is not clear what the shape you want should be, but you can try to use vtkImageOpenClose3D so the steps are:
First, load 3D points from file as vtkPolyData.
Then, use vtkVoxelModeller
Put voxelModeller output to vtkImageOpenClose3D algorithm, then vtkImageOpenClose3D algorithm output to MC (change to vtkFlyingEdges3D) algorithm and finally visualize
Example for vtkImageOpenClose3D:
https://www.vtk.org/Wiki/VTK/Examples/Cxx/Images/ImageOpenClose3D

How do CAD programs display parametric models?

Softwares like Catia, SolidWorks or the like all can visualize complex models while designing.
Exporting such models to raster triangle meshes yields huge files that later need to be greatly simplified to be imported into 3D engines like Unreal Engine or equivalent.
My question is: how do they visualize such complex geometries without rasterization? How do they do it that fast?
GPUs can only deal with triangles, therefore they tessellate geometry exactly as for STL export. Tessellation tolerance may vary from display to STL export affecting the time required to compute it.
Exporting such models to raster triangle meshes yields huge files
Not entirely correct. When you ask solidworks for the mesh you also provide quality that will influence number of triangles you receive - can be millions, can be just a dozen.
CAD packages operate with most bodies/shapes analytically - they have a formula. My guess is any other 3D engine does the same, the thing is format of the analytical data that different engines use is not the same. So you need to convert from one to another using triangles, format that everybody understands.

Converting voxelized model into smooth form

I have a 3D model as mesh structure or in .stl/.obj format which I converted to voxels using binvox voxelization tool. Using a Java program, I have done some processing on the voxel grid thus obtained. Now, I wish to covert this voxelized model back into a "smooth" mesh structure (or any other format), which can later be exported to .stl or .obj format.
Can someone suggest how can I achieve the last part, i.e. converting the voxel grid into some format for retrieving back the "smooth" surfaces ? Any help, including pointing to existing tools, or relevant theory in this direction will be appreciated.
Give a try to Marching Cubes algorithm. See http://paulbourke.net/geometry/polygonise/ for more details.

Could I create a photorealistic 3D model of an object from photographs of the object taken from different angles?

Say I have a very large amount of photographs of an object, all from different angles, so that one can through these photographs view the object from whatever angle is desired.
Is there a way to take these photographs and combine them into a photorealistic 3D model of the object that could then be displayed just like a traditional 3D model and moved around/rotated?
The reason I am asking is that I am working on a project where a traditional 3D model will not do and we need photorealistic quality, but we would still like the ability to rotate, zoom and pan around the object.
Thanks for your help
This sounds very much like Photosynth. Check out the demo at TED in 2007 for a nice example using images sourced from flickr to build a model of Notre Dame cathedral (about half way through the presentation).
Here is a little answer to your big big question...
you will have to find the edges, interpret them as a boundary (like a series of different spline cross sections)
interpolate enough missing points to give desired resolution, which could be done my using the parallel points in series a0,a1,a2... as a series of points in a bezier path. (like a string wound around the model)

Resources