Discussion:
[vtkusers] Remeshing using Octree Filter
Sebastian
2017-09-21 09:45:22 UTC
Permalink
Hello, I found this great article by Vincent Rivola about remeshing by using an octree filter combination, but I don’t get the right combination.

He wrote: “One of them is taking a triangulated surface as input, it creates a volume octree grid around it in a few seconds. Then I can simply compute the distance field on each point of the volume mesh in order to finaly make an iso-surface and get my remeshed shaped."

https://www.linkedin.com/pulse/remeshing-using-octree-volume-mesh-vincent-rivola <https://www.linkedin.com/pulse/remeshing-using-octree-volume-mesh-vincent-rivola>

Unfortunately I’m didn’t get a response from him yet, so I’m trying to ask you now?

Thank you very much!
vincentrivola
2017-09-21 11:36:47 UTC
Permalink
Hi,

Thanks for your interest in this work.
Where did you try to contact me? What would you like to know?

Regards,



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
sebastianandress
2017-09-21 12:27:51 UTC
Permalink
Hello,

thank you very much for your answer!
I unconventionally contacted you via facebook, because I don't have a
linkedin account :/ but now I'm glad I could reach you here!

Can you maybe tell me which filter combination you used?

I guess you started with the vtkTriangleFilter, followed by the
vtkHyperOctree to create the distance field. But then I don't know how you
created the iso-surface out of that.

Thank you so much!
Sebastian



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Dean Inglis
2017-09-21 12:34:43 UTC
Permalink
Hi Vincent,

I am also interested in your approach to smoothing with VTK. Nice work
you have posted on linked in: the rocket firing simulation was very
impressive!
Would you be able to post a simple example of your smoothing pipeline that
could be made into an entry for the the vtk wiki examples?

best regards,
Dean
Post by vincentrivola
Hi,
Thanks for your interest in this work.
Where did you try to contact me? What would you like to know?
Regards,
--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at http://www.kitware.com/
opensource/opensource.html
http://www.vtk.org/Wiki/VTK_FAQ
Search the list archives at: http://markmail.org/search/?q=vtkusers
http://public.kitware.com/mailman/listinfo/vtkusers
vincentrivola
2017-09-21 13:01:35 UTC
Permalink
Hi again,

I don't have much time for the wiki right now since it is a very busy
period.
But basically here is the pipeline (as a side note I use the java wrapper
for all these applications):
- create an octree mesh around your surface. For this I use my own octree
generator not vtkHyperOctree. If someone know how to get it directly in vtk
I'm interested.

- once I get my octree grid as a vtkUnstructuredGrid I loop over all the
points of the mesh and use a vtkImplicitPolyDataDistance filter initialized
with my original surface to get the distance between each point of the
unstructured grid and the vtkPolyData.

- then I can use this distance in a vtkContourFilter to get the iso-surface
of distance=0.

- eventually use a vtkSmoothPolyDataFilter on the output of vtkContourFilter
to smooth a bit the results.

That's it! pretty simple actually.



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Bill Lorensen
2017-09-22 00:04:29 UTC
Permalink
Here are other ways to remesh.

Look at these examples:

https://lorensen.github.io/VTKExamples/site/Cxx/Points/ExtractSurface/
https://lorensen.github.io/VTKExamples/site/Cxx/Points/PowercrustExtractSurface/
https://lorensen.github.io/VTKExamples/site/Cxx/Points/PoissonExtractSurface/
and a compariison
https://lorensen.github.io/VTKExamples/site/Cxx/Points/CompareExtractSurface/


On Thu, Sep 21, 2017 at 9:01 AM, vincentrivola
Post by vincentrivola
Hi again,
I don't have much time for the wiki right now since it is a very busy
period.
But basically here is the pipeline (as a side note I use the java wrapper
- create an octree mesh around your surface. For this I use my own octree
generator not vtkHyperOctree. If someone know how to get it directly in vtk
I'm interested.
- once I get my octree grid as a vtkUnstructuredGrid I loop over all the
points of the mesh and use a vtkImplicitPolyDataDistance filter initialized
with my original surface to get the distance between each point of the
unstructured grid and the vtkPolyData.
- then I can use this distance in a vtkContourFilter to get the iso-surface
of distance=0.
- eventually use a vtkSmoothPolyDataFilter on the output of vtkContourFilter
to smooth a bit the results.
That's it! pretty simple actually.
--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Search the list archives at: http://markmail.org/search/?q=vtkusers
http://public.kitware.com/mailman/listinfo/vtkusers
--
Unpaid intern in BillsBasement at noware dot com
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
vincentrivola
2017-09-22 08:36:57 UTC
Permalink
Dear Bill,

Indeed, these are very good examples as well.
Could you tell me where did you find the horse you use in the examples? I
would like to try it on my side in order to see the result I get.

Regards



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Bill Lorensen
2017-09-22 11:27:24 UTC
Permalink
The horse is here:
https://github.com/lorensen/VTKExamples/blob/master/src/Testing/Data/horse.ply


On Fri, Sep 22, 2017 at 4:36 AM, vincentrivola
Post by vincentrivola
Dear Bill,
Indeed, these are very good examples as well.
Could you tell me where did you find the horse you use in the examples? I
would like to try it on my side in order to see the result I get.
Regards
--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Search the list archives at: http://markmail.org/search/?q=vtkusers
http://public.kitware.com/mailman/listinfo/vtkusers
--
Unpaid intern in BillsBasement at noware dot com
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
sebastian_a
2017-09-22 09:08:01 UTC
Permalink
Thank you very much!

Indeed I'm trying to remesh a vtkPolyData. My problem is the following:
My polydata contains both, very small AND very large triangular faces. I'm
trying to get a mesh with faces of equal size.

Possible solutions would be:
- Subdivision filter which divides till a set face size. Is there any filter
out there?
- Any kind of remeshing. I once wrote this
<http://vtk.1045678.n5.nabble.com/Remeshing-vtkPolyData-with-vtkMarchingCubes-td5742651.html>
, but it is slow and the result isn't really good.

Is there any better approach?

Thanks, Sebastian



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
sebastian_a
2017-09-22 10:13:07 UTC
Permalink
I quickly wrote this handy script to iterate through a vtkPolyData and
subdivide the cells till they are smaller than a given boundary. It's not
very fast but maybe it could be an inspiration for a new vtk filter:


def extractPolyData(polydata, idsArrayOfPoints, FieldType, inverse):
#FieldType: cell = 0, point = 1
selectionNode = vtk.vtkSelectionNode()
selectionNode.SetFieldType(FieldType)
selectionNode.SetContentType(4)
selectionNode.SetSelectionList(idsArrayOfPoints)
selectionNode.GetProperties().Set(vtk.vtkSelectionNode.CONTAINING_CELLS(),
1)

if inverse == True:
selectionNode.GetProperties().Set(vtk.vtkSelectionNode.INVERSE(),1)

selection = vtk.vtkSelection()
selection.AddNode(selectionNode)

extractSelection = vtk.vtkExtractSelection()
extractSelection.SetInputData(0, polydata);
extractSelection.SetInputData(1, selection)
extractSelection.Update()

selected = vtk.vtkUnstructuredGrid()
selected.ShallowCopy(extractSelection.GetOutput())

extractionPolydata = vtk.vtkPolyData()
extractionPolydata.SetPoints(selected.GetPoints())
extractionPolydata.SetPolys(selected.GetCells())

return extractionPolydata


def remesh(polyData, boundary):
# Find Large Faces
largeFacePolyData = polyData
smallFacePolyData = vtk.vtkPolyData()

while largeFacePolyData.GetNumberOfCells() > 0:
ids = vtk.vtkIdTypeArray() # IDs of cells
ids.SetNumberOfComponents(1)
for i in xrange(largeFacePolyData.GetNumberOfCells()):
if getBoundaryOfCell(largeFacePolyData.GetCell(i)) > boundary:
ids.InsertNextValue(i)

smallFaces = extractPolyData(largeFacePolyData, ids, 0, True)
if smallFacePolyData.GetNumberOfCells() > 0:
appendFilter = vtk.vtkAppendPolyData()
appendFilter.AddInputData(smallFaces)
appendFilter.AddInputData(smallFacePolyData)
appendFilter.Update()
smallFacePolyData = appendFilter.GetOutput()
else:
smallFacePolyData = smallFaces

# subdivide
largeFaces = extractPolyData(largeFacePolyData, ids, 0, False)
subdivisionFilter = vtk.vtkLinearSubdivisionFilter()
subdivisionFilter.SetNumberOfSubdivisions(1)
subdivisionFilter.SetInputData(largeFaces)
subdivisionFilter.Update()
largeFacePolyData = subdivisionFilter.GetOutput()

return smallFacePolyData



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Micro_Coconut
2018-11-14 15:41:53 UTC
Permalink
Hi,

Could you please tell me how to do the visualization as your 1st picture
shows? (Mesh/point cloud with Octree)

Thank you!



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers

Loading...