pytha.create_polygon_ex - pytha-3d-cad/pytha-lua-api GitHub Wiki

Similar to the Faces -> Polygon function in the PYTHA user interface.

pytha.create_polygon_ex(
    {{loop_points_1, loop_segments_1} [,{loop_points_2, loop_segments_2} [,...]] }, 
    [,origin [,options]]]]) 
Parameter Type Description
loop_points_i {{u,v [,w]}, ...} Coordinates of the loop points
loop_segments_i {segment_1, segment_2, ...} Optional specification of the segments, where each segment may be a table to indicate the following options:
segment_i.angle number Angle of the arc, positive for counter-clockwise arcs
segment_i.radius number Radius of the arc
segment_i.orientation "cw" or "ccw" For radius specification: clockwise or counter-clockwise orientation
segment_i.select_arc "small", "large" For radius specification: selection of the small or large arc with that radius and orientation
segment.bulge number Maximum distance between the secant and the arc, positive for counter-clockwise arcs
segment.segments integer Number of edge-segments for this polyline-segment
origin {x,y,z} Optional: offset of the whole polyline
options {...} Optional: a table that may contain the following options:
options.u_axis {x,y,z} Local coordinate u-axis for the orientation of the plane
options.v_axis {x,y,z} Local coordinate v-axis for the orientation of the plane
options.w_axis {x,y,z} Local coordinate w-axis for the orientation of the plane-normal

Return value

Type Description
element_handle An element handle of the newly created part

Note:

For the polygon-segments, entry loop_segments[n] in the segment table describes the polyline-segment between point loop_points[n] and loop_points[n+1]. The first loop must have a well defined orientation; it is therefore not valid to define e.g. a semicircle via two points of which one has an arc.

See also:

pytha, element handles, Axes and directions, create_polygon, create_polyline_ex