Skip to content

Latest commit

 

History

History
79 lines (66 loc) · 1.81 KB

File metadata and controls

79 lines (66 loc) · 1.81 KB

ConvertToArcPolyline

Description

Convert, within a tolerance, the input polyline into an polyline that uses arcs for the curves.

FUNCTION ConvertToArcPolyline(
				hPolygon : HANDLE;
				dFuzz    : REAL): HANDLE;
def vs.ConvertToArcPolyline(hPolygon, dFuzz):
    return HANDLE

Parameters

Name Type Description
hPolygon HANDLE
dFuzz REAL

Remarks

(_c_, 2022.02.02) This routine must be updated, it still doesn't recognize Radius vertexes.

As of VW 2022 the routine behaves on vertexes as such:

  • corner: preserved
  • arc: preserved only on dFuzz = 0, otherwise they turn into corner, which is truly strange, since the purpose IS to create arc vertexes
  • radius: ignored, turn into corner
  • cubic: turn into arc
  • bezier: turn into arc

Examples

VectorScript

PROCEDURE Test;
VAR
    polyObj, newPolyObj : HANDLE;
	
BEGIN
    { select a polyline }
    polyObj := FSActLayer;
    IF polyObj <> NIL THEN BEGIN
        newPolyObj := ConvertToArcPolyline(polyObj, 0);
        SetDSelect(polyObj);
    END;
END;
Run(Test);

Python

# select a polyline
polyObj = vs.FSActLayer()
if polyObj != vs.Handle( 0 ):
	newPolyObj = vs.ConvertToArcPolyline(polyObj, 0)
	vs.SetDSelect(polyObj)
resultH := ConvertToArcPolyline(hPolygon, 1.0);
import vs

# Convert, within a tolerance, the input polyline into an polyline that uses
# arcs for the curves.
hPolygon = vs.FSActLayer()  # handle to the first selected object on the active layer
dFuzz = 1.0

objHandle = vs.ConvertToArcPolyline(hPolygon, dFuzz)
if objHandle is not None:
    vs.Message('Created object handle: ' + str(objHandle))

Version

Availability: from Vectorworks 2014

Category