[Bf-python] RE: Bf-python digest, Vol 1 #267 - 1 msg

Bob Holcomb bob_holcomb at hotmail.com
Thu Mar 25 02:18:23 CET 2004


would creating a new mesh, coping the verticies over, but none of the face 
data work.  Then delete the old mesh.  That should be pretty quick.

Cheers,

bob


>From: bf-python-request at blender.org
>Reply-To: bf-python at blender.org
>To: bf-python at blender.org
>Subject: Bf-python digest, Vol 1 #267 - 1 msg
>Date: Wed, 24 Mar 2004 12:00:02 +0100
>
>Send Bf-python mailing list submissions to
>	bf-python at blender.org
>
>To subscribe or unsubscribe via the World Wide Web, visit
>	http://www.blender.org/mailman/listinfo/bf-python
>or, via email, send a message with subject or body 'help' to
>	bf-python-request at blender.org
>
>You can reach the person managing the list at
>	bf-python-admin at blender.org
>
>When replying, please edit your Subject line so it is more specific
>than "Re: Contents of Bf-python digest..."
>
>
>Today's Topics:
>
>    1. efficient way to remove faces and edges from a mesh with python? 
>(wim van hoydonck)
>
>--__--__--
>
>Message: 1
>From: "wim van hoydonck" <tuinbels at hotmail.com>
>To: bf-python at blender.org
>Date: Tue, 23 Mar 2004 13:09:48 +0000
>Subject: [Bf-python] efficient way to remove faces and edges from a mesh 
>with python?
>Reply-To: bf-python at blender.org
>
>Hi all,
>
>I need to remove all faces and edges from a large mesh with python (see
>example
>script below). But it seems to be extremely time-inefficient for large
>meshes. I
>thought the time would increase linearly with the number of faces that has
>to be
>removed, instead the time needed increases exponentially.
>The little table below shows some results for a UV-sphere.
>The last one even gave a negative time?
>
>I hope somebody can tell me what I do wrong, or give a better solution for
>this
>problem.
>
>Kind regards,
>Wim Van Hoydonck
>
>-----------------------------------------------------------
>number of faces(approx)       time [sec]
>256                               0.01
>1024                              0.04
>4020                              0.86
>6872                              3.5
>9572                              8.1
>38512                           141.4
>154592                        -2033.847
>------------------------------------------------------------
>import Blender
>from Blender import Object
>import time
>
>m = Object.GetSelected()[0].getData()
>
>idx = []
>for i in range(len(m.faces)):
>	idx.append(i)
>
>idx.reverse()
>
>start = time.clock()
>for i in idx:
>	fa = m.faces[i]
>	m.faces.remove(fa)
>end = time.clock()
>
>print end - start
>
>m.update()
>
>_________________________________________________________________
>Ben jij klaar voor De Vuilbek? http://devuilbek.msn.be/start.php Nu op JIM
>en MSN
>
>
>
>--__--__--
>
>_______________________________________________
>Bf-python mailing list
>Bf-python at blender.org
>http://www.blender.org/mailman/listinfo/bf-python
>
>
>End of Bf-python Digest

_________________________________________________________________
MSN Toolbar provides one-click access to Hotmail from any Web page – FREE 
download! http://toolbar.msn.com/go/onm00200413ave/direct/01/




More information about the Bf-python mailing list