Model compounding

Previous topic - Next topic

matchy

As I can do this in 3dsmax, I was wondering if there is any snippets or libs for mesh compounding/subtracting.  :-[ For example, a cube is half way in a sphere and then, from two meshes, one new mesh is created with the subtracted vertices inside each model, or one model adds vertices in replace of the "cookie" bite subtraction from the other model.


erico

#1
There must be ´polygon boolean´ somewhere, it should do it.


edit: oops read it wrongly, I thought you were looking for how to do it on 3ds.

matchy

I've attempted polygon slicing and so I suppose it's much of the same thing. The algorithms I explored for that all deal with loops through the vertices and including and excluding where required, but it get's a bit tricky there in technique.

mentalthink

I´m not sure how do this marchy, bt at least for me I think it´s a bit comples, perhaps it´s comething like collision beetween arrays... but I prefer use a 3D suite, it´s more easy  =D

Perhaps you can take infor from blender... you can download all the code of the complete 3D suite, and looking into it...
I donwloaded sometime ago, but when I sat Visual Studio compile I have some errors, basically for my ignorance about programming  :-[ :-[

matchy

Initially I was just hoping for an existing library, most likely in c because theoretically I can do it but I feel why invent the wheel.  ;/

For example, SUBTRACT_OBJ(obj_cookie, obj_teeth) where obj_ is a poly vertex array.   :-[ Check for each obj_teeth poly edge line intersection with each obj_cookie poly edge line. Mark entry and exit for toggling adding/removing vertices to new object.

It's a bit complex just for 2d you see.  :zzz: 

mentalthink

hi Matchy perhaps this can help you
http://www.cgal.org/

I´m not very sure, but I read about Booleans and a lot of thing for geometry...

In this video it´s a bit explained...


bigsofty

Constructive Solid Geometry is quite a complex subject, it's not a trivial task to produce in code. What do you need it for?
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

erico

Great Video! :good:
Reminds me of sculptris where you can also add and remove mesh detail while sculping, really nice.

mentalthink

HI Erico the good thing it´s the attached library... I Suppose this it´s for use whit OpenGL, and can do, a 3D editor or 3D simlation software... seems a very complex library...

matchy

CGAL looks good MT so I'll check it out later!


mentalthink

Ok, Matchy, perhaps I try to understand a bit... I think it´s something very interesting. And for make a 3D modeller I thin can do it, in fact some modellers I read are made whit this library.