how to determine if a mesh is closed

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  01 January 2009
how to determine if a mesh is closed

Simple question hopefully with a simple answer. How can I determine if a mesh is closed or not?
 
  01 January 2009
you could loop through the edges and see if any edge is only contained in one face... that face would be open

mark
__________________
Morph Controls Script
*NEW Website*
comming soon!!!



 
  01 January 2009
Why not just use an STL modifier to check it?
__________________
Maxscript Made Easy...
http://davewortley.wordpress.com/
 
  01 January 2009
that could work but has the potential to be extremely slow, especially looping over multiple objects. I was hoping there was a built in function.

After writing the above and before posting I had a quick look at the edit_poly mod and came up with this function:
fn isClosedMesh o =
(
	addModifier o (edit_poly())
	m = o.modifiers[1]
	faces = #{1..(m.GetNumFaces())}
	m.SetSelection #Face faces
	isMeshClosed = (m.convertSelectionToBorder #Face #Edge) == 0
	deleteModifier o 1
	isMeshClosed
)

It only seems to work with the modify panel open though which is a pain

Anyone know of a better way to do this?
 
  01 January 2009
-- For Editable Meshes and Polys:
(meshOp.getOpenEdges $).isEmpty
(polyOp.getOpenEdges $).isEmpty

-- true: the surface is closed
-- false: the surface is open

Cheers

- Enrico
__________________
IllusionCatalyst Instrument set for 3ds Max │ AliquaForma Personal portfolio in fieri
 
  01 January 2009
Thanks Dave I'd completely forgotton about the STL modifier.

SyncViewS, your solution is nice and tidy. I don't think I've ever used getOpenEdges before. Thanks heaps
 
  01 January 2009
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 11:41 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.