# Creating a wireframe from an STL file

**URL:** https://discourse.paraview.org/t/creating-a-wireframe-from-an-stl-file/9118
**Category:** ParaView Support
**Tags:** python
**Created:** [March 5, 2022, 12:11am UTC](https://discourse.paraview.org/t/creating-a-wireframe-from-an-stl-file/9118 "2022-03-05T00:11:53Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Rlo](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/r/838e76/32.png) [@Rlo](https://discourse.paraview.org/u/Rlo)
#### Post date: [March 5, 2022, 12:11am UTC](https://discourse.paraview.org/t/creating-a-wireframe-from-an-stl-file/9118/1 "2022-03-05T00:11:53Z")

</div>

I have followed the PyGSLIB tutorial ([Tutorial: Resource estimation with PyGSLIB — PyGSLIB 0.0.0.3.9 documentation](https://opengeostat.github.io/pygslib/Tutorial.html)) and am now ready to try running the code on my own data. I have successfully imported the drillhole tables, created the drillhole objects… all the way to tagging my samples with the domain code.

I encounter a problem when I get to the code lines:

```auto
>># creating a partial model by filtering out blocks with zero proportion inside the solid
>>mymodel.set_blocks(mymodel.bmtable[mymodel.bmtable['D1']> 0])

>># export partial model to a vtk unstructured grid (*.vtu)
>>mymodel.blocks2vtkUnstructuredGrid(path='model.vtu')

```

where the kernel dies, specifically when trying to export the model to a VTU file format. To explore some more I tried declustering the parameters, but when I entered the code:

```auto
>>wtopt,vrop,wtmin,wtmax,error, \
xinc,yinc,zinc,rxcs,rycs,rzcs,rvrcr = pygslib.gslib.declus(parameters_declus)

```

The kernel did not complete the task, and I was not able to plot the deculstered optimization results.

> --------------------------------------------------------------------------- NameError Traceback (most recent call last) Input In [27], in 1 #Plotting declustering optimization results ----\> 2 plt.plot (rxcs, rvrcr, ‘-o’) 3 plt.xlabel(‘X cell size’) 4 plt.ylabel(‘declustered mean’)
> 
> NameError: name ‘rxcs’ is not defined
> 
> ERROR! Session/line number was not unique in database. History logging moved to new session 118

As far as I can tell, this is because I have not set up an appropriate wireframe - the STL file I have does not seem to have the geospatial data listed in terms of meters (which I think the data from the tutorial is)… but I can’t seem to find a way to convert the data from my STL file to a useable format.

My question is: Can I use ParaView to convert an STL file of a 3D portion of the earth’s surface downloaded from [3D-mapper.com](http://3D-mapper.com), into a useable wireframe to continue with the PyGSLIB code?

If anyone could shed some light on this issue, I would really appreciate it.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 7, 2022, 8:53am UTC](https://discourse.paraview.org/t/creating-a-wireframe-from-an-stl-file/9118/2 "2022-03-07T08:53:26Z")

</div>

> [@Rlo](#):
>
> `set_blocks`

This is a pygslib question, not a ParaView question. Maybe ask on their github ?

> **[GitHub - opengeostat/pygslib: GSLIB fortran code wrapped into python](https://github.com/opengeostat/pygslib)**
>
> GSLIB fortran code wrapped into python. Contribute to opengeostat/pygslib development by creating an account on GitHub.
