<div dir="ltr"><div><div style="font-family:Helvetica;font-size:medium;word-wrap:break-word">Hello all,</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">
My name is Luki. </div><div style="font-family:Helvetica;font-size:medium;word-wrap:break-word">I'm new in yt. </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">
I have a problem in extracting object from yt. I want to have the surface object in .obj or .ply file so then i can transform it to .u3d for 3d pdf</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">I have a data cube that i build this way.</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">
<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 12px/normal Helvetica">from yt.mods import *</p>
<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 12px/normal Helvetica">from numpy import *</p>
<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 12px/normal Helvetica"><br></p><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 12px/normal Helvetica">
myfile=loadtxt("3ddata_300_lowerres.txt")</p></div><div style="font-family:Helvetica;word-wrap:break-word"><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 12px/normal Helvetica">
</p><p style="font-size:medium;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 12px/normal Helvetica">dens=myfile[:,3]</p>
<p style="font-size:medium;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 12px/normal Helvetica">densitycube=dens.reshape(61,61,61)</p><p style="font-size:medium;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 12px/normal Helvetica">
<br></p><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 12px/normal Helvetica"></p><p style="font-size:medium;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 12px/normal Helvetica">
<span class="">mydata=dict(Density=</span>densitycube<span class="">)</span></p>
<p style="font-size:medium;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 12px/normal Helvetica">bbox=np.array([[-300,300],[-300,300],[-300,300]])</p>
<p style="font-size:medium;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 12px/normal Helvetica">pf=load_uniform_grid(mydata,densitycube.shape,3.08e18,bbox=bbox)</p><p style="font-size:medium;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 12px/normal Helvetica">
<br></p><p style="font-size:medium;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 12px/normal Helvetica"><span class="" style="font-size:medium">Then, I would like to have a surface of certain value in my data and extract it to .obj files</span><br>
</p><p style="font-size:medium;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 12px/normal Helvetica"><span class="" style="font-size:medium"><br></span></p><p style="font-size:medium;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 12px/normal Helvetica">
<span class="" style="font-size:medium"></span></p><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 12px/normal Helvetica">sp = pf.h.sphere("center", (250, "pc"))</p>
<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 12px/normal Helvetica">trans = 1.0</p>
<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 12px/normal Helvetica">distf = 3.08e18</p>
<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 12px/normal Helvetica">surf = pf.h.surface(sp, "Density", 0.0006)</p>
<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 12px/normal Helvetica">surf.export_obj("myism.obj", transparency=trans, dist_fac = distf)</p><div><br></div>
<div>But i have a problem with segmentation fault.</div><div><br></div><div>Segmentation fault: 11<br></div><div><br></div><div>I'll also try export_ply but i have the same problem :(</div><div><br></div><div><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 12px/normal Helvetica">
sp = pf.h.sphere("center", (250, "pc"))</p>
<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 12px/normal Helvetica">surf = pf.h.surface(sp, "Density", 0.0006)</p>
<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 12px/normal Helvetica">bounds = [(sp.center[i] - 125.0/pf['pc'],sp.center[i] + 125.0/pf['pc']) for i in range(3)]</p>
<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font:normal normal normal 12px/normal Helvetica">surf.export_ply("myism.ply",bounds=bounds)</p></div><div><br></div><div>Can you help me? </div>
<div><br></div><div>Thankyou in advance</div><div><br></div><div>Best regards,</div><div>luki</div><div><br></div><p></p><p></p><p></p></div>
</div>