def test_SimpleWithSurfaceAndDefaults(self):
     id = rs.AddCircle((0, 0, 0), 20)
     srf_id = rs.AddPlanarSrf(id)
     pt_ids = rs.AddPoints([(-20, 0, 0), (0, 20, 0), (20, 0, 0)])
     id = rs.AddPatch(pt_ids, srf_id)
     brep = rs.coercebrep(id, True)
     self.assertTrue(brep.IsSurface)
Beispiel #2
0
def PatchMulti():
    try:
        geo = rs.GetObjects('Select Closed Polylines', preselect=True)

        if geo:

            uv1 = rs.GetInteger('enter number of UV divisions',
                                number=1,
                                minimum=1)

            rs.EnableRedraw(False)
            for objects in geo:
                rs.AddPatch((objects), (uv1, uv1), tolerance=0.0001)
            rs.EnableRedraw(True)

    except:
        print("Failed to execute")
        rs.EnableRedraw(True)
        return
Beispiel #3
0
def surface_from(*curves):
    cs = unvarargs(curves)
    refs = shapes_refs(cs)
    if is_singleton(refs):
        ref = refs[0]
        if isinstance(ref, geo.Point):
            id = ref
        else:
            ids = rh.AddPlanarSrf(refs)
            if ids:
                id = singleton(ids)
            else:
                id = rh.AddPatch(refs, 3, 3)
    elif len(refs) < 0:  #Temporary fix for Funda's problem# 5:
        id = rh.AddEdgeSrf(refs)
    else:
        id = rh.AddPlanarSrf(refs)
    delete_shapes(cs)
    return id
 def test_SimpleWithUVSpansAndDefaults(self):
     pt_ids = rs.AddPoints([(-20, 0, 0), (0, 20, 0), (20, 0, 0)])
     id = rs.AddPatch(pt_ids, (10, 10))
     brep = rs.coercebrep(id, True)
     self.assertTrue(brep.IsSurface)
 def test_InvalidArgumentsReturnsNone(self):
     self.assertTrue(rs.AddPatch(uniquestr(), uniquestr()) == None)