Create a surface from multiple points

Options
Gabriel Messager
Gabriel Messager Member, Employee Posts: 49
5 Likes Name Dropper First Anniversary Ansys Employee
edited June 2023 in 3D Design

Comments

  • Gabriel Messager
    Gabriel Messager Member, Employee Posts: 49
    5 Likes Name Dropper First Anniversary Ansys Employee
    Options
    from System import Tuple
    
    ClearAll()
    
    p1 = Point.Create(0,0,0)
    p2 = Point.Create(0,10,0)
    p3 = Point.Create(5,15,0)
    p4 = Point.Create(10,10,0)
    p5 = Point.Create(10,0,0)
    
    points = [p1, p2, p3, p4,p5]
    
    list_points = List[Tuple[Point, Point]](Tuple.Create(points[i-1], points[i]) for i in range(len(points)))
    list_curves = CurveSegment.Create(list_points)
    d_curves = [DesignCurve.Create(GetRootPart(), curve) for curve in list_curves]
    
    result = Fill.Execute(Selection.Create(d_curves))
    surface = Selection.Create(result.CreatedFaces[0])
    Delete.Execute(Selection.Create(d_curves))