|
#1
|
|||
|
|||
|
remove internal parts
hi!
i was just wondering if there exist some tool that selects/removes internal parts? if i could remove objects that are inside other objects, it would save me a massive amount of polys and rendertimes Last edited by kimgar; 03-20-2010 at 05:02 AM. |
|
#2
|
|||
|
|||
|
i read something about shooting rays from many angles and sampling objects that way using maxscript, sounds complicated for my maxscript skills, but i might give it a shot some time.
does anyone think it could be done at all? or would you end up with a script that never ever finishes? |
|
#3
|
|||
|
|||
|
Hi kimgar,
I won't delve far into the technical details, but what you describe is theoretically possible. Unfortunately, given the current level of maxscript exposure in our objects, it may be difficult to do through maxscript. Assuming maxscript had access to the relevant functions, how difficult and slow this process would be depends on the accuracy desired, the nature of the objects being tested (true solids are easier to work with in this context), and how effectively the program 'shortcuts' its way around unnecessary calculations. Writing such a program from scratch would be a non-trivial undertaking. Luckily, you might not need to start from scratch. The following approaches might serve as starting points if you decide to tackle this problem: One approach could be to get our Booleans tool to do the work for you. The Pwr_Boolean tool does expose some functionality to maxscript, enough that it should be possible to clone two Brep Objects, boolean subtract the bigger one (bounding box volume-wise) from the smaller one. If the result has a bounding box that is comparatively much smaller than the original breps (say under a thousandth of the size), it may be a good indication that the 'smaller' brep object is entirely interior to the bigger one. However, this depends on both Brep Objects being solids, and will also be slow (especially if a large number of brep object pairs are being compared this way). In terms of difficulty of writing the necessary maxscript code, this approach is probably one of the easiest 'do it yourself' solutions to this problem, as the Boolean tool would handle most of the complexity for you. I will mention an alternative approach as well: instead of working with the Brep Objects directly, do the test with a viewport mesh resulting from the Brep. Functionality related to meshes should be sufficiently exposed to maxscript to do the following. If the two breps being compared generate water-tight (solid) meshes, then it is sufficient to check whether any of the polygons of one mesh intersect any of the polygons in the other. If no such intersections exist, then one of the meshes is entirely contained by the other, and a bounding box check should tell you which mesh is the 'interior' mesh. Then just select the corresponding Brep Object. It is worth noting that without doing some work to eliminate trivial intersections (both at the individual polygon pair level, and the brep object level), the time it takes to do this grows VERY quickly with polygon counts and mesh counts. |
|
#4
|
|||
|
|||
|
hi michael!
and thanks a lot for all the tips on the subject! luckily i don't need to do the tests on brep/nurb objects, i'm just importing huge assemblies straight to powermesh and then run some cleanup, which is where this script would be the mother of all scripts! the boolean approach is interesting, never thought of that, and the bounding box trick would be sweet, but ofcourse i'm not that lucky. i will be dealing with, say 1k objects and 1m polys, and i'm having issues with attaching powermeshes, so for now, individual objects will have to remain individual. so, hehe, imagine a saucepan with a lid on it, and a nice fish cooking inside - how to remove the fish? hmmm...mhmh... |
![]() |
| Thread Tools | |
| Display Modes | |
|
|