Skip to content

Project polygons upon a surface and remove cut out portions of surface inside (or) outside the projected polygon.

License

Notifications You must be signed in to change notification settings

jspanchu/SurfaceCutter

Repository files navigation

SurfaceCutter

Cut triangulated surfaces with 2D loop polygons.

Build

mkdir build
cd build
cmake .. -GNinja -DTSC_BUILD_PARAVIEW_PLUGIN=ON -DTSC_WRAP_PYTHON=ON
ninja install

Usage

ParaView

Filters -> SCUT -> Triangulation Cutter

C++

#include <tscTriSurfaceCutter.h>

vtkNew<tscTriSurfaceCutter> cutter;

// xxx: filter that outputs a vtkPolyData
cutter->SetInputConnection(0, xxx->GetOutputPort());
// yyy: filter that outputs a vtkPolyData
cutter->SetInputConnection(1, yyy->GetOutputPort());

cutter->Update();
cutMesh = cutter->GetOutput(0); 

Python

import tsc
...
cutter = tsc.tscTriSurfaceCutter()
cutter.SetInputConnection(triangulation.GetOutputPort())
cutter.SetLoopsConnection(1, loops.GetOutputPort())
...

InsideOut = true

InsideOut = false

Imprint: On | Remove: Off | Invert: NA

Imprint: On | Remove: On | Invert: On

Imprint: On | Remove: On | Invert: Off

Imprint: Off | Remove: On | Invert: On

Imprint: Off | Remove: On | Invert: Off

Real-time

Benchmark

./benchmark <option(s)>Options:
        -h,--help       Show this help message
        -m,--mesh       Specify mesh file (*.vtp, *.vtu)
        -l,--loops      Specify loops file (*.vtp)
        -i,--invert     Invert 2d boolean. Portions inside loops will be removed.
        -t,--translationspeed   Speed multiplier for mesh translations along x, y, z
        -r,--rotationspeed      Speed multiplier for mesh rotation along z
           --movable    Make the mesh movable.
           --vtkcookiecutter    Use vtkCookieCutter instead
           --vtkclipdataset     Use vtkClipDataset with vtkImplicitSelectionLoop instead


Controls:
W:    Z+ | S:     Z-
Up:   Y+ | Down:  Y-
Left: X+ | Right: X-
Z:   CCW | C:     CW (Looking down Z-)
K:ScaleUp| H:ScaleDown

About

Project polygons upon a surface and remove cut out portions of surface inside (or) outside the projected polygon.

Resources

License

Stars

Watchers

Forks

Packages

No packages published