Jump to content
Sign in to follow this  
konstantin magnus

Clipping tools: Bricker from center and radial

Recommended Posts

Here are two simple clipping tools using python SOP verbs: Bricker and Radial.

clipping_tool.png.4a6944088f8d5bc6261d777477f27390.png

Unlike the divide SOP it´s cutting always right through the center.

python_cutting.hip

Edited by konstantin magnus
  • Like 6

Share this post


Link to post
Share on other sites

Some exemplary code for easy access:

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().clear()
node.geometry().merge(geo)

 

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×