Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@lazy
def extract_curve(shp):
return pyservoce.extract_curve(shp)
@lazy.lazy(cls=nocached_shape_generator)
def cylinder(r):
return pyservoce.cylinder_surface(r)
def volumed_collision(model, alpha=0.05, resolution=100000):
inpath = os.path.join(zencad.lazifier.lazy.cache.tmpdir(), model.__lazyhexhash__[12:] + "collision" + ".obj")
outpath = os.path.join(zencad.lazifier.lazy.cache.tmpdir(), model.__lazyhexhash__[12:] + "collision.vhacd" + ".obj")
logpath = os.path.join(zencad.lazifier.lazy.cache.tmpdir(), model.__lazyhexhash__[12:] + "collision.log" + ".txt")
nodes, triangles = zencad.triangulate(model, 0.01)
write_as_obj_wavefront(inpath, nodes, triangles)
volumed_collision_do(model, inpath, outpath, logpath, alpha, resolution)
return outpath
@lazy
def ellipse(major, minor):
return pyservoce.curve2_ellipse(major, minor)
@lazy.lazy(cls=shape_generator)
def difference(arr):
return pyservoce.difference(arr)
@lazy.lazy(cls=shape_generator)
def sweep(proto, path, frenet=False):
return pyservoce.pipe_shell(proto, path, frenet)
@lazy.lazy(cls=nocached_shape_generator)
def bspline(pnts, knots, muls, degree, periodic=False, check_rational=True, weights=None):
"""Построение дуги круга по трем точкам"""
pnts = points(pnts)
if weights:
return pyservoce.bspline(
pnts=pnts,
knots=knots,
weights=weights,
multiplicities=muls,
degree=degree,
periodic=periodic,
check_rational=check_rational)
else:
return pyservoce.bspline(
pnts=pnts,
@lazy
def near_vertex(shp, pnt):
"""Find near vertex to point `pnt` in shape `shp`
Return vertex as point.
"""
return pyservoce.near_vertex(shp, pnt).vertices()[0]
@lazy.lazy(cls=shape_generator)
def near_edge(shp, pnt):
"""Find near edge to point `pnt` in shape `shp`"""
return pyservoce.near_edge(shp, pnt)
@lazy
def interpolate(pnts, tangs=[], closed=False):
return pyservoce.interpolate_curve3(points(pnts), vectors(tangs), closed)