Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def set_gravity(self, x, y=None, z=None):
v = zencad.util.vector3(x,y,z)
#v = v * self.scale_factor
p.setGravity(*v)
def pipe_shell(
wires,
spine,
frenet=False,
binormal=vector3(0,0,0),
parallel=vector3(0,0,0),
force_approx_c1=False,
solid=True,
discrete=False,
path=None):
if path is not None:
spine = path
print("pipe: path option is renamed. use spine instead")
#if isinstance(proto, pyservoce.libservoce.Shape):
# return pyservoce.pipe_shell(proto, path, frenet)
fwires = []
for w in wires:
if isinstance(w, pyservoce.Face):
fwires.append(w.outwire())
else:
fwires.append(w)
def linear_extrude(proto, vec, center=False):
if isinstance(vec, (int, float)):
vec = vector3(0, 0, vec)
return pyservoce.linear_extrude(proto, vector3(vec), center)
def linear_extrude(proto, vec, center=False):
if isinstance(vec, (int, float)):
vec = vector3(0, 0, vec)
return pyservoce.linear_extrude(proto, vector3(vec), center)
#if isinstance(proto, pyservoce.libservoce.Shape):
# return pyservoce.pipe_shell(proto, path, frenet)
fwires = []
for w in wires:
if isinstance(w, pyservoce.Face):
fwires.append(w.outwire())
else:
fwires.append(w)
return pyservoce.pipe_shell(
wires=fwires,
spine=spine,
frenet=frenet,
force_approx_c1=force_approx_c1,
binormal=vector3(binormal),
parallel=vector3(parallel),
discrete=discrete,
solid=solid)
def to_vector(arg):
return zencad.util.vector3(arg)
def rotate(ax, angle):
return pyservoce.rotate(vector3(ax), angle)
# return pyservoce.pipe_shell(proto, path, frenet)
fwires = []
for w in wires:
if isinstance(w, pyservoce.Face):
fwires.append(w.outwire())
else:
fwires.append(w)
return pyservoce.pipe_shell(
wires=fwires,
spine=spine,
frenet=frenet,
force_approx_c1=force_approx_c1,
binormal=vector3(binormal),
parallel=vector3(parallel),
discrete=discrete,
solid=solid)