示例#1
0
def resizemesh(msh, vec):
    """resizemesh(mesh,vector) where mesh is a mesh object and vector is a Base.Vector"""
    poly = mesh2polyhedron(msh)
    vec_string = '['+str(vec.x)+','+str(vec.y)+','+str(vec.z)+']'
    param = 'resize('+vec_string+')'
    mi = callopenscadmeshstring('%s{%s}' % (param,''.join(poly)))
    mi.flipNormals()
    return mi
def meshopinline(opname,iterable1):
    """uses OpenSCAD to combine meshes
    takes the name of the CGAL operation and an iterable (tuple,list) of 
    FreeCAD Mesh objects
    includes all the mesh data in the SCAD file
    """
    from exportCSG import mesh2polyhedron
    return callopenscadmeshstring('%s(){%s}' % (opname,' '.join(\
        (mesh2polyhedron(meshobj) for meshobj in iterable1))))
示例#3
0
def mirrormesh(msh, vec):
    """mirrormesh(mesh,vector) where mesh is a mesh object and vector is a Base.Vector"""
    from exportCSG import mesh2polyhedron
    from PySide import QtGui
    poly = mesh2polyhedron(msh)
    vec_string = '[' + str(vec.x) + ',' + str(vec.y) + ',' + str(vec.z) + ']'
    param = 'mirror(' + vec_string + ')'
    mi = callopenscadmeshstring('%s{%s}' % (param, ''.join(poly)))
    mi.flipNormals()
    return mi