Weld and Optimize Primitive/Mesh by Code

Blitz3D Forums/Blitz3D Programming/Weld and Optimize Primitive/Mesh by Code

RustyKristi(Posted 2016) [#1]
Is there a way to merge and join a geometrically positioned mesh like a cube fitted together and remove backfaces inside to make it more efficient?

I just need the faces/normals pointed outside and discard all inside.


Bobysait(Posted 2016) [#2]
You'll probably find a CSG library in the code archive.
It should do the job but it's not always the best approach for optimized results.


RustyKristi(Posted 2016) [#3]
thanks bobysait, could you point out the link?


RustyKristi(Posted 2016) [#4]
nvm found it here, hope this is the right one:

http://www.blitzbasic.com/codearcs/codearcs.php?code=560


RemiD(Posted 2016) [#5]
If you make the shapes yourself, then you know which triangles can be removed depending on the position/orientation of the shape related to the others shapes (especially if the shapes are simple like cubes!)

You could use their normals to identify them (in which direction their are facing)


Bobysait(Posted 2016) [#6]
@RemiD : It might seem easy but intersections between two box is already pretty hard.
If the box are perfectly aligned and of the same size, no problem, but ... it would just mean : Make a bigger box !

For any other case, you'll have to create some faces to fill the holes, and trust me, it's all but that easy. (at least, in a procedural way)


RemiD(Posted 2016) [#7]
Of course it can be difficult depending on how you position/oriente the shapes, i was thinking if the shapes were positioned on a grid, in this case it should be simpler.