Untitled Document

Home Register FAQ Members List Inst Messg Chat Room Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   nPower Software User Forums > nPower Software Discussion > Power Translators for Max / Viz
 
Tags:

Reply
  #1  
Old 03-19-2010, 05:22 AM
kimgar kimgar is offline
Registered User
 
Join Date: Nov 2008
Posts: 34
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.
Reply With Quote
  #2  
Old 03-20-2010, 05:20 AM
kimgar kimgar is offline
Registered User
 
Join Date: Nov 2008
Posts: 34
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?
Reply With Quote
  #3  
Old 03-22-2010, 11:27 AM
nPower_Michael nPower_Michael is offline
Registered User
 
Join Date: Jan 2009
Posts: 108
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.
Reply With Quote
  #4  
Old 03-23-2010, 04:00 AM
kimgar kimgar is offline
Registered User
 
Join Date: Nov 2008
Posts: 34
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...
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 11:55 AM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Protected and Supported by vBCoderz.com