<div dir="ltr"><div class="gmail_extra"><div><div style="font-family:Helvetica;font-size:medium;word-wrap:break-word">Wow. Thankyou verymuch. It works ;)</div></div><div style="font-family:Helvetica;font-size:medium;word-wrap:break-word">

<br></div><div style="font-family:Helvetica;font-size:medium;word-wrap:break-word">Best regards,</div><div style="font-family:Helvetica;font-size:medium;word-wrap:break-word">Lucky</div>
<br><br><div class="gmail_quote">On 20 August 2013 21:38, Matthew Turk <span dir="ltr"><<a href="mailto:matthewturk@gmail.com" target="_blank">matthewturk@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


Hi Luki,<br>
<br>
Welcome to yt!  Sorry you're having trouble.<br>
<br>
I was able to get it to work by adding this line:<br>
<br>
surf["Density"]<br>
<br>
just after surf=<br>
<br>
I believe this is a genuine bug, as what I think is going on is that<br>
the triangles are not getting created properly.  Once that line went<br>
in, yt would go and walk the surface and create the vertices.  I don't<br>
know why it's not doing that by default, so I have filed a bug to<br>
ensure that it gets addressed:<br>
<br>
<a href="https://bitbucket.org/yt_analysis/yt/issue/633/vertices-not-correctly-created-in-surface" target="_blank">https://bitbucket.org/yt_analysis/yt/issue/633/vertices-not-correctly-created-in-surface</a><br>
<br>
You may also find it a bit nicer if you use "pf.h.all_data()" instead<br>
of the sphere, as the sphere will cut off any data outside that<br>
spherical region.  Anyway, try with the line surf["Density"] before<br>
the export, and let us know if that works.<br>
<br>
-Matt<br>
<div><div><br>
On Tue, Aug 20, 2013 at 1:42 PM, Lucky Puspitarini<br>
<<a href="mailto:lucky.puspitarini@gmail.com" target="_blank">lucky.puspitarini@gmail.com</a>> wrote:<br>
> Hello all,<br>
><br>
> My name is Luki.<br>
> I'm new in yt.<br>
><br>
> I have a problem in extracting object from yt. I want to have the surface<br>
> object in .obj or .ply file so then i can transform it to .u3d for 3d pdf<br>
><br>
> I have a data cube that i build this way.<br>
><br>
> from yt.mods import *<br>
><br>
> from numpy import *<br>
><br>
><br>
> myfile=loadtxt("3ddata_300_lowerres.txt")<br>
><br>
> dens=myfile[:,3]<br>
><br>
> densitycube=dens.reshape(61,61,61)<br>
><br>
><br>
> mydata=dict(Density=densitycube)<br>
><br>
> bbox=np.array([[-300,300],[-300,300],[-300,300]])<br>
><br>
> pf=load_uniform_grid(mydata,densitycube.shape,3.08e18,bbox=bbox)<br>
><br>
><br>
> Then, I would like to have a surface of certain value in my data and extract<br>
> it to .obj files<br>
><br>
><br>
> sp = pf.h.sphere("center", (250, "pc"))<br>
><br>
> trans = 1.0<br>
><br>
> distf = 3.08e18<br>
><br>
> surf = pf.h.surface(sp, "Density", 0.0006)<br>
><br>
> surf.export_obj("myism.obj", transparency=trans, dist_fac = distf)<br>
><br>
><br>
> But i have a problem with segmentation fault.<br>
><br>
> Segmentation fault: 11<br>
><br>
> I'll also try export_ply but i have the same problem :(<br>
><br>
> sp = pf.h.sphere("center", (250, "pc"))<br>
><br>
> surf = pf.h.surface(sp, "Density", 0.0006)<br>
><br>
> bounds = [(sp.center[i] - 125.0/pf['pc'],sp.center[i] + 125.0/pf['pc']) for<br>
> i in range(3)]<br>
><br>
> surf.export_ply("myism.ply",bounds=bounds)<br>
><br>
><br>
> Can you help me?<br>
><br>
> Thankyou in advance<br>
><br>
> Best regards,<br>
> luki<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> yt-users mailing list<br>
> <a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
><br>
_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
</blockquote></div><br></div></div>