Conversion of 3D WireFrame into 3D Solid Models - c

I have been working with some 3D Wire Frame Models, which are essentially a large number of vertices which are joined together by edges or line segments to create a 3D Wire Frame of a 3D Object.
I was wondering what would it take to convert this 3D Wire Frame Model into a 3D Solid Model. What algorithms can be used to achieve this?
Right now what I have is a sequence of points that I join together using line segments,What would it take me to fill the regions created by these line segments to produce a 3d Solid Model?
The platform is Linux using C.
Any help would be greatly appreciated. Thanks.

The usual method is breaking the wireframe model into separate triangles. Than you can assign surface parameters to the triangles, such as color information.

Related

Can I train a CNN on 3d images?

I am working with the 2015 BRATS Dataset of MRI Brain Tumors. The files in the dataset are in .mha format and have many slices of 2d images that make up a 3d brain. Is there a way I can train the model on these images or do I have to convert them somehow? If so, how do I convert them?
A normal RGB image is already a 3 dimensional input. So you can just stack all the images and instead of maybe 3 channels you have 30 (for 10 stacked rgb images). You can process this data like you would process any other imgae.
What you can also try with this kind of data is using 3D convolutions on them. This way you have a 3 dimensional kernel like 3x3x3 (maybe even more in channel direction) and you slide it over the input in x,y and channel direction. This can help and boost the performance but will increase the runtime.

Calculations on Geodesic Grid & Plotting Data of Geodesic Grid - any C Librarys availible?

I have a couple of questions regarding computations in C on a geodesic grid.
I want to numerically solve equations for the time evolution of a scalar field on the surface of a sphere.
It seems that the geodesic grid is a convenient way to parametrize the surface of the sphere and to store it in the computers memory.
An explanation on one possible data structure is given here:
http://kiwi.atmos.colostate.edu/BUGS/geodesic/text.html
I would like to know:
Are there any C Libraries available which I can use to simplify my life, or should I create the data structure myself?
Having a data structure such as the one presented in the link above, are there any programs to visualize functions that are defined on the grid? (I want to plot some computed value for every grid point, but visualized on the sphere).
For this would it be best to write on code that assigns every grid point a set of angles (theta, phi) and then plot with e.g gnuplot?
Any help is appreciated.
Thank you.

WPF 3D and Helix 3D toolkit graphics with ~500,000 triangles in one viewport- optimizing

I am new to stack overflow and new to 3D graphics programming. I have been given the task of creating an app that will read in data (currently I am reading from a delimited text file, but eventually will read from data arrays) and to graphically display the data in 3D. The data is x,y,z coordinates read from a 3D scanner which is scanning logs. I need to show the 3D representation of these logs on screen, from 4 different angles. I am reading the data into a 2-dimensional Point3D array and then using it to create 3D models in a HelixViewport3D. I use a nested for loop to check that the data points in the array are within certain x,Z bounds- and if they are I need to create a triangle out of that data. Once the entire array is passed through, I add the Model3DGroup to the children of my viewport:
topModel.Content = topGroup;
this.mainViewport.Children.Add(topModel);
It takes about 8 seconds for this to take place and zooming,panning, rotating are very very slow with all this data on the screen (around 500,000 triangles). Are there any ways to improve performance of WPF 3D graphics? I actually don't need to be able to zoom/pan/rotate in the finished app but it is helpful for debugging. The final app will simply be the same model shown statically 4 different ways, from different sides. However, I need to be able to read in the data and get the graphics to display in 1-5 seconds. Any help is greatly appreciated, and I hope my question is fairly clear!
EDIT: After doing some more digging into vertex buffering, this is what I need to do. I am using way too many points. If anyone can point me to some literature on doing vertex/index buffering in c#, it would be greatly appreciated!
I have solved this issue. Thanks for the input Capt Skyhawk! You saying that you doubted this was a WPF3D shortcoming helped me look in the right places. My problem was that the way I wrote this made every triangle it's own ModelVisual3D!! I re-wrote the code to contain only 3 GeometryModel3D (sp?) objects, and all the triangles are placed in a MeshGeometry3D and then the mesh is used to create a model. This made the models render in < 0.1 seconds. I now have a new issue- for some reason only about half of the triangles are showing up in the model in my viewports. I'm not sure why, though it may be that I have too many Point3D points or too many triangle indices in my mesh.
I doubt this is a shortcoming in WPF3D. It's more than likely the loading process. Parsing a text file with 500,000 triangles(even more points!) is where the bulk of the processing time is being spent.
If the loading of the text file is not being included in the 8 seconds, something is very wrong.
Are you using index buffers? If not, you're shooting yourself in the foot with that many vertices.

How to apply several side images to WPF 3D model?

I have already a 3D model for a planet and 4 pictures of front (0 degree), left (270), right (90) and back (180) side of the planet. Is there any known way to apply these 4 photos for texture of the 3D model?
I thought about combining these pictures into one like panoramic view and then apply it to the model. But that might be overkill. Maybe there is a way to apply 2D texture to the 2D view of 3D model like WYSWYG. Any hint would be appreciated.
Your best bet would be to combine the images into a single rectangular projection and then map that to the sphere using a spherical mapping.
Assuming your images are circular the first step is to create square images from those. A Mercator projection will probably work best.

direct access to pixel data in wpf 3d

Is there a lockbits equivalent of 2d in 3d in Windows Presentation Foundation to get direct pixel access ?
I understand you can paint a triangle at a time: 3d for the threst of us. Wouldn't it be easier to paint in cubes instead of triangles ? (I need to paint a stack of images such as an mri sequence).
The WriteableBitmap class allows you to access the pixels, I'm a bit unsure what you want with regards to 3d but you should be able to use a WriteableBitmap as the texture for each item and position them in 3D as required. For creating a stack of images 3D Panel and FluidKit's ElementFlow might be of interest to you.
Triangles are used because 3 points always make a flat surface this makes shading simpler and predictable plus you can make any shape if you use enough triangles.
If by painting in cubes you mean tiny cubes similar to how you use pixels in 2D these are known as Voxels they have their use-cases but most hardware and software are designed with polygons in mind.

Resources