跳到主要内容

IDP.Math.KGeomLib.offsetPath2dWithDistances() method

偏移一组有序的2d曲线,每条曲线的偏移值单独设置 若 delta 大于零,曲线偏移方向为左边;若 delta 小于零,曲线偏移方向为右边 例如:考虑一条逆时针绕向的 path,若 delta 皆大于零,则 path 将向外扩张;若 delta 皆小于零,则 path 将向内收缩

Offset a 2d path with different distances. If the delta > 0, the path will be offset at right side, else if delta < 0, the path will be offset at left side. For example: A CCW path, if delta > 0, the path will be enlarged. if delta < 0, the path will be shrinked.

Signature:

offsetPath2dWithDistances(path: KBoundedCurve2d[], deltas: number[], disTol?: number, cosTol?: number): KPath2dOffsetRet;

Links: offsetPath2dWithDistances(path: KBoundedCurve2d[], deltas: number[], disTol?: number, cosTol?: number): KPath2dOffsetRet;

Parameters

Parameter

Type

Description

path

KBoundedCurve2d[]

输入一组有序的2d曲线集合。

Input 2d curves in order.

deltas

number[]

输入2d曲线集合对应的偏移量。

Input each 2d curve offset delta.

disTol

number

(Optional) 输入距离容差,默认1.0e-6。 Input distance tolerance, use 1.0e-6 by default.

cosTol

number

(Optional) 输入角度容差,默认1.0e-6。 Input cosine tolerance, use 1.0e-6 by default.

Returns:

KPath2dOffsetRet

返回偏移结果。

Return offset path result.