Clipping tools using Python verbs

calendar_today

14.05.2023

label

Python, Programming

mouse

Houdini 19.5

Description

Repeatedly calling the clip node's functionality using Python verbs in order to create cutting patterns on a mesh.

1 Code

PYTHON
        import math
node = hou.pwd()
geo = node.geometry()

cuts = node.evalParm('cuts')

clip = hou.sopNodeTypeCategory().nodeVerb('clip')

for i in range(cuts - 1):
    angle = i / (cuts - 1.0)
    dir = hou.Vector3(math.sin(angle * math.pi), 0.0, math.cos(angle * math.pi))
    clip.setParms({
        'dir': dir,
        'clipop': 2
    })
    geo.execute(clip, [])
    if hou.updateProgressAndCheckForInterrupt():
            break

node.geometry().merge(geo)
    

2 Documentation on Python Verbs

download

Downloads

link

Related articles

favorite

230

label

Python

Remove Outliers from Point Clouds

favorite

422

label

PythonProgramming

Multivariate Interpolation with RBF

favorite

473

label

AutomationPythonProgramming

Batch processing files with Python

favorite

401

label

RenderingPythonProgramming

Convert Meshes to Vector Graphics

favorite

380

label

VEXPythonProgramming

Lighting 2D triangles from a 3D mesh

favorite

392

label

ModelingPython

Minimal Spanning Tree with Clustering