首页 / design / oaArc

oaArc

模块: oapy._oa._design 导入: from oapy._oa import _design

概览

oaArcoapy 中可用,可通过 _design 模块访问。

本页汇总 oaArc 当前在 oapy 中可用的 Python 接口。

详细说明

The oaArc class implements an arc shape。 An arc is a segment on the circumference of an ellipse, and can be defined by three parameters: an ellipse bounding box, a start angle, and a stop angle。 The oaArc::create function uses these three input parameters to create and return a pointer to an arc segment。 How Arcs are Specified in OpenAccess In OpenAccess, arc angles are specified in positive radians, and are defined counterclockwise from a reference line that emanates from the center of the ellipse on which the arc is defined (at the intersection of imaginary x/y axes that pass through the ellipse center point)。 The positive (right-side) x axis is at 0 radians; the positive (upper) y axis is at pi/2 radians; and the left x axis is at pi radians。 The figures below show two arc segments, each with a sweep angle (stop angle minus start angle) that does not exceed pi radians (180 degrees)。 Note that the figures also depict a bounding box for each arc segment -- this is a box that fully encloses the arc segment and intersects the arc at its start and stop angles。 This arc bounding box, together with the ellipse bounding box, can be input to oaArc::calcArc to obtain the arc start and stop angles for input to the oaArc::create function。 Also, oaArc::calcBBox will return the arc bounding box when passed the ellipse bounding box and the arc start and stop angles。 Any arc sweep angle generated from calcArc is equal to or less than pi radians (equal to or less than 180 degrees)。 This is to avoid ambiguity in the interpretation of the calcArc arguments。 However, the start angle and stop angles supplied to oaArc::create can have any values, positive, negative, or zero。 These angles are normalized to [0,2pi)。 The start and stop angles cannot be equivalent (zero length arcs are not allowed)。

方法总览

状态 Python 调用
obj.getEllipseBBox(bBox)
obj.getStartAngle()
obj.getStopAngle()
obj.getPoints(points, numSegs=10)
obj.set(ellipseBBox, startAngle, stopAngle)
obj.convertToLine(numSides=16)
_design.oaArc.create(block, layerNum, purposeNum, ellipseBBox, startAngle, stopAngle)
_design.oaArc.calcArc(p1, p2, p3, ellipseBBox, startAngle, stopAngle)
_design.oaArc.calcArc(ellipseBBox, bBox, startAngle, stopAngle)
_design.oaArc.calcBBox(ellipseBBox, startAngle, stopAngle, bBox)
_design.oaArc.genPoints(ellipseBBox, startAngle, stopAngle, numEdges, boundary)

方法说明

obj.getEllipseBBox(bBox)

绑定状态: 已绑定

Python 调用: obj.getEllipseBBox(bBox)

This function returns the ellipse bounding box associated with this arc。

参数

  • bBox: Returned ellipse bounding box。

Python 示例

from oapy._oa import _design

# assume obj is a oaArc
obj.getEllipseBBox(bBox)

obj.getStartAngle()

绑定状态: 已绑定

Python 调用: obj.getStartAngle()

This function retrieves the start angle of this arc in radians。

Python 示例

from oapy._oa import _design

# assume obj is a oaArc
obj.getStartAngle()

obj.getStopAngle()

绑定状态: 已绑定

Python 调用: obj.getStopAngle()

This function retrieves the stop angle of this arc in radians。

Python 示例

from oapy._oa import _design

# assume obj is a oaArc
obj.getStopAngle()

obj.getPoints(points, numSegs=10)

绑定状态: 已绑定

Python 调用: obj.getPoints(points, numSegs=10)

This function returns a point array that delineates this arc。 numSegs specifies the number of segments to use to delineate the arc, and determines the number of points returned in the pointArray -- specifically, the returned pointArray will contain numSegs+1 points。 See oaArc::genPoints for a static function that generates and returns a point array that delineates an arc for a specified set of arc parameters。

参数

  • points: Returned series of points delineating a line that represents this arc (returned pointArray will contain numSegs+1 points)。
  • numSegs: Number of segments to use to delineate the arc。

Python 示例

from oapy._oa import _design

# assume obj is a oaArc
obj.getPoints(points, numSegs=10)

obj.set(ellipseBBox, startAngle, stopAngle)

绑定状态: 已绑定

Python 调用: obj.set(ellipseBBox, startAngle, stopAngle)

This function resets the ellipse bBox and start/stop angles of this arc to the specified values。

参数

  • ellipseBBox: Ellipse bounding box to set on this arc。
  • startAngle: Start angle to set in radians。
  • stopAngle: Stop angle in radians。

异常

  • oacArcEllipseBBoxInvalid
  • oacArcAnglesInvalid

Python 示例

from oapy._oa import _design

# assume obj is a oaArc
obj.set(ellipseBBox, startAngle, stopAngle)

obj.convertToLine(numSides=16)

绑定状态: 已绑定

Python 调用: obj.convertToLine(numSides=16)

This function converts this arc to an oaLine using the specified number of sides。

参数

  • numSides: Number of segments used to represent the arc as a line, which must be at least two; the default number of sides is 16。

异常

  • oacArcNumSidesInvalid

Python 示例

from oapy._oa import _design

# assume obj is a oaArc
obj.convertToLine(numSides=16)

_design.oaArc.create(block, layerNum, purposeNum, ellipseBBox, startAngle, stopAngle)

绑定状态: 已绑定

Python 调用: _design.oaArc.create(block, layerNum, purposeNum, ellipseBBox, startAngle, stopAngle)

This function creates an arc in the specified block with the specified layer/purpose pair using the specified ellipseBBox, startAngle, and endAngle parameters。 The latter three parameters are checked to verify that they represent a valid arc。 Note that the ellipseBBox cannot be arealess。 The start angle and stop angle can have any values, positive, negative, or zero。 These angles are normalized to [0,2pi)。 The start and stop angles cannot be equivalent (zero length arcs are not allowed)。

参数

  • block: Pointer to the block in which the arc will be created。
  • layerNum: Layer number for the arc。
  • purposeNum: Purpose number for the arc。
  • ellipseBBox: Ellipse bounding box for the arc。
  • startAngle: Starting angle of the arc in radians。
  • stopAngle: Ending angle of the arc in radians。

异常

  • oacArcEllipseBBoxInvalid
  • oacArcAnglesInvalid

Python 示例

from oapy._oa import _design

_design.oaArc.create(block, layerNum, purposeNum, ellipseBBox, startAngle, stopAngle)

_design.oaArc.calcArc(p1, p2, p3, ellipseBBox, startAngle, stopAngle)

绑定状态: 已绑定

Python 调用: _design.oaArc.calcArc(p1, p2, p3, ellipseBBox, startAngle, stopAngle)

This utility function takes the specified ellipse bounding box and arc bounding box as input parameters and fills in the startAngle and stopAngle parameters (these latter two parameters along with the ellipseBBox are needed to create an arc with oaArc::create )。 The input parameters are checked to verify that they represent a valid arc。 The arc sweep angle, which is the stop angle minus the start angle, generated from this function is equal to or less than pi radians (equal to or less than 180 degrees)。 This is to avoid ambiguity in the interpretation of the calcArc arguments。

参数

  • ellipseBBox: Ellipse bounding box。
  • bBox: Arc bounding box, which can be a minimum or larger arc bounding box as long as it intersects the arc at its ellipse start and stop angles; OpenAccess will trim the box to its minimum size。
  • startAngle: Returned starting angle of the arc in radians。
  • stopAngle: Returned stopping angle of the arc in radians。

异常

  • oacArcWrongNumIntercepts

Python 示例

from oapy._oa import _design

_design.oaArc.calcArc(p1, p2, p3, ellipseBBox, startAngle, stopAngle)

_design.oaArc.calcArc(ellipseBBox, bBox, startAngle, stopAngle)

绑定状态: 已绑定

Python 调用: _design.oaArc.calcArc(ellipseBBox, bBox, startAngle, stopAngle)

This utility function converts input points, p1, p2, and p3 into return parameters, ellipseBBox, startAngle, and stopAngle。 The returned values are needed to create an arc with oaArc::create 。 OpenAccess verifies that the three input points represent a valid arc。 The order in which the points are supplied is not relevant。 OpenAccess determines the appropriate return parameters based on the rules for arc sweep angles。 Refer to How Arcs are Specified in OpenAccess for more information。 The arc sweep angle, which is the stop angle minus the start angle, generated from this function is equal to or less than pi radians (equal to or less than 180 degrees)。 This is to avoid ambiguity in the interpretation of the calcArc arguments。

参数

  • p1: Location of the first oaPoint on the arc。
  • p2: Location of the second oaPoint on the arc。
  • p3: Location of the third oaPoint on the arc。
  • ellipseBBox: Returned ellipse bounding box。
  • startAngle: Returned starting angle of the arc in radians。
  • stopAngle: Returned ending angle of the arc in radians。

异常

  • oacArcPointsColinear
  • oacArcTooLarge

Python 示例

from oapy._oa import _design

_design.oaArc.calcArc(ellipseBBox, bBox, startAngle, stopAngle)

_design.oaArc.calcBBox(ellipseBBox, startAngle, stopAngle, bBox)

绑定状态: 已绑定

Python 调用: _design.oaArc.calcBBox(ellipseBBox, startAngle, stopAngle, bBox)

This utility function calculates and returns the bBox of an arc (the arc bounding box) based on the specified ellipseBBox, startAngle and stopAngle parameters。 The input parameters are checked to verify they represent a valid arc。

参数

  • ellipseBBox: Ellipse bounding box。
  • startAngle: Starting angle of the arc in radians。
  • stopAngle: Ending angle of the arc in radians。
  • bBox: Returned arc bounding box; OpenAccess trims the box to its minimum size。

Python 示例

from oapy._oa import _design

_design.oaArc.calcBBox(ellipseBBox, startAngle, stopAngle, bBox)

_design.oaArc.genPoints(ellipseBBox, startAngle, stopAngle, numEdges, boundary)

绑定状态: 已绑定

Python 调用: _design.oaArc.genPoints(ellipseBBox, startAngle, stopAngle, numEdges, boundary)

This function calculates and returns a point array in points that delineates the arc specified by the ellipseBBox, startAngle, and stopAngle parameters。 The number of edges delineated by the point array are specified by numEdges。 The point array delineates the arc by representing it as a sequence of points connecting virtual line segments that approximate the arc。 See oaArc::getPoints for a function that generates and returns a point array that delineates an existing oaArc object。

参数

  • ellipseBBox: Ellipse bounding box。
  • startAngle: Starting angle of the arc in radians。
  • stopAngle: Ending angle of the arc in radians。
  • numEdges: Number of edges to use to delineate the arc。
  • points: Returned point array that represents the delineated arc。

Python 示例

from oapy._oa import _design

_design.oaArc.genPoints(ellipseBBox, startAngle, stopAngle, numEdges, boundary)