The HalfSpace node is used to divide 3D space by a plane. It cannot be visualized since it is unbounded but is useful with boolean operations when you want to simply cut off or only include regions of a part or model beyond some plane.
The plane of the half space is defined by the normal axis by setting the position and direction on the node. The side attribute takes a point that is considered inside the space.
from math import pi, sin, cos
from declaracad.occ.api import *
enamldef Assembly(Part):
Axis:
pass
# To visualize the plane being cut
Plane: p:
color = 'blue'
transparency = 0.9
position = (5, 5, 7)
direction = (1, 1, 1)
bounds = [(-30,-30), (30, 30)]
Cut:
transparency = 0.2
Box:
dz = 20
dx = 10
dy = 30
HalfSpace:
# If no child is given a plane is built using the position and direction
position = p.position
direction = p.direction
# A point do define which side of the plane to cut off
side = (0, 0, 1)
