Monday, 15 March 2010

python - Using tetgen or triangle (or meshpy) to create a hollow dome -


I am using Tetan to try to make a hollow dome. I was using the triangle and then triangulating a circle and z equation z according to sqrt (abs (r ^ 2 - x ^ 2 - y ^ 2)), but i have to raise the z values Pulling was very bad.

So I just want to generate a bunch of this dome number and then I would like to trap it without filling it. Titz basically gives it to me by giving the .node and .faces files, but the problem is I'm still going down and I'm not sure how to get rid of it. I am very new to Tetan and Mashupi, so if someone can give me a work flow for this, I would greatly appreciate it. The answer can actually be very simple. For example, I am able to make points around the bottom of the circle with a simple task:

  def gen_pts_on_circle (num_pts), radius): point placement for i in np.arange For the use of theta via pnts = [] theta = 360.0 / num_pts # loop (0, 360, theta): x = radius * np.cos (np.radians (i)) y = radius * np. Sin (np.radians (i)) z = 0.0 pnts.append ((x, y, z)) return np.array (pnts)  

then

  def gen_random_pts (num_pts, radius): for points = [] I in xrange (num_pts): q = np. Random.random (I generate random digits on the dome using the function) * (np.pi * 2.0) r = np.sqrt (np.random.random ()) x = (radius * r) * np.cos (cue ) Area equation with stomach value to create y = (radius * r) * np.sin (cue) # gom z = np.sqrt (stomach (r ** 2 - x ** 2 - y ** 2)) Returns ((X, Y, Z)) np.ar Ray (pts)  

Then I just slapped the header from .node file and. Run tetgen to get file file. The only problem with this approach is below, when I need it to be an open dome.

I will use more Messy, but these points have to be created and then feed it in the spinach so that nothing returns ....

  from meshpy.tet Import MeshInfo, generating all of the points using pts_circ = gen_pts_on_circle # build (100, 5) digits = np.vstack ((pts_circle, gen_random_pts (500, 5))) #tet mesh_info = MeshInfo () mesh_info .set_points (building with digits) Mesh = build (info)  

Print np.array (mesh.facets) and print np.array (mesh.points) are now just empty arrays.

Do anyone have any ideas about using meshpy without using this build method to install all aspects as well or to make aspects like command line tetan? It really does not get rid of my problem that is not open under the dome though, but I am trying to do some work. Any help would be greatly appreciated. Thanks!

Just looking for this answer for someone else, so I have met the creator of meshpy. By default you will have to override the options to get rid of the default 'pq' commands. Then

  meshpy.tet is import option from MeshInfo, opt = option from it, overriding 'pq' with an option or flags mesh_info = MeshInfo, creating options ("") # () net = Construction (mesh_info = Opts)  

Hope that helps someone who can stop this problem.


No comments:

Post a Comment