How to use the zencad.lazifier.lazy function in zencad

To help you get started, we’ve selected a few zencad examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mirmik / zencad / zencad / geom / curve3.py View on Github external
@lazy
def extract_curve(shp):
	return pyservoce.extract_curve(shp)
github mirmik / zencad / zencad / geom / surface.py View on Github external
@lazy.lazy(cls=nocached_shape_generator)
def cylinder(r):
    return pyservoce.cylinder_surface(r)
github mirmik / zencad / zencad / libs / bullet.py View on Github external
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
github mirmik / zencad / zencad / geom / curve2.py View on Github external
@lazy
def ellipse(major, minor):
    return pyservoce.curve2_ellipse(major, minor)
github mirmik / zencad / zencad / geom / boolean.py View on Github external
@lazy.lazy(cls=shape_generator)
def difference(arr):
	return pyservoce.difference(arr)
github mirmik / zencad / zencad / geom / ops3d.py View on Github external
@lazy.lazy(cls=shape_generator)
def sweep(proto, path, frenet=False):
	return pyservoce.pipe_shell(proto, path, frenet)
github mirmik / zencad / zencad / geom / prim1d.py View on Github external
@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,
github mirmik / zencad / zencad / __init__.py View on Github external
@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]
github mirmik / zencad / zencad / __init__.py View on Github external
@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)
github mirmik / zencad / zencad / geom / curve3.py View on Github external
@lazy
def interpolate(pnts, tangs=[], closed=False):
    return pyservoce.interpolate_curve3(points(pnts), vectors(tangs), closed)