oaPath
模块: oapy._oa._design
导入: from oapy._oa import _design
概览
oaPath 在 oapy 中可用,可通过 _design 模块访问。
本页汇总 oaPath 当前在 oapy 中可用的 Python 接口。
详细说明
The oaPath class implements the oaPath object, which derives from the oaShape class。 An oaPath object represents a path that contains a point array and has certain width and style represented by oaPathStyle 。 Two coincident and three collinear points are illegal, and an exception is thrown if these combinations are detected。 You can use oaPointArray::compress() to remove these combinations。 For more information on coincident and collinear points, see oaPointArray::compress() Paths that have segments whose length is less than half the width of the path might have self-intersecting boundaries。 These boundaries might have unexpected geometry。
方法总览
| 状态 | Python 调用 |
|---|---|
| ✅ | obj.getWidth() |
| ✅ | obj.getNumPoints() |
| ✅ | obj.getPoints(points) |
| ✅ | obj.getStyle() |
| ✅ | obj.getBeginExt() |
| ✅ | obj.getEndExt() |
| ✅ | obj.getBoundary(boundary) |
| ✅ | obj.isOrthogonal() |
| ✅ | obj.setWidth(width) |
| ✅ | obj.setPoints(points) |
| ✅ | obj.setStyle(style) |
| ✅ | obj.setBeginExt(beginExt) |
| ✅ | obj.setEndExt(endExt) |
| ✅ | obj.convertToPolygon() |
| ✅ | _design.oaPath.create(block, layerNum, purposeNum, width, points, style=oacTruncatePathStyle, beginExt=0, endExt=0) |
| ✅ | _design.oaPath.genBoundary(points, width, style, beginExt, endExt, boundary) |
方法说明
obj.getWidth()
绑定状态: 已绑定
Python 调用: obj.getWidth()
This function returns the width of this oaPath in database units。
Python 示例
from oapy._oa import _design
# assume obj is a oaPath
obj.getWidth()
obj.getNumPoints()
绑定状态: 已绑定
Python 调用: obj.getNumPoints()
This function returns the number of points in the oaPath, which is the number after the oaPath is compressed by oaPath::create() 。
Python 示例
from oapy._oa import _design
# assume obj is a oaPath
obj.getNumPoints()
obj.getPoints(points)
绑定状态: 已绑定
Python 调用: obj.getPoints(points)
This function gets the point array of an oaPath object。 The point array consists of the points along the centerline of the oaPath after the oaPath is compressed by oaPath::create() 。
参数
points: The pointArray of the oaPath after compression。
返回
- Void。
Python 示例
from oapy._oa import _design
# assume obj is a oaPath
obj.getPoints(points)
obj.getStyle()
绑定状态: 已绑定
Python 调用: obj.getStyle()
This function returns the style of the oaPath。
返回
- oaPathStyle。
Python 示例
from oapy._oa import _design
# assume obj is a oaPath
obj.getStyle()
obj.getBeginExt()
绑定状态: 已绑定
Python 调用: obj.getBeginExt()
This function returns the beginning extension of an oaPath in database units。 By definition, the extension is zero if the oaPathStyle is anything other than oacVariablePathStyle。
返回
- An oaUInt4 that is the beginning extension of the oaPath, in database units。
Python 示例
from oapy._oa import _design
# assume obj is a oaPath
obj.getBeginExt()
obj.getEndExt()
绑定状态: 已绑定
Python 调用: obj.getEndExt()
This function returns the ending extension of an oaPath in database units。 By definition, the extension is zero if the oaPathStyle is anything other than oacVariablePathStyle。
返回
- An oaUInt4 that is the ending extension of the oaPath, in database units。
Python 示例
from oapy._oa import _design
# assume obj is a oaPath
obj.getEndExt()
obj.getBoundary(boundary)
绑定状态: 已绑定
Python 调用: obj.getBoundary(boundary)
This function constructs a boundary with the polygonal outline of the path。 This function is useful for overlap checks with the path, and to render what the path looks like。
参数
boundary: The generated boundary point array。
Python 示例
from oapy._oa import _design
# assume obj is a oaPath
obj.getBoundary(boundary)
obj.isOrthogonal()
绑定状态: 已绑定
Python 调用: obj.isOrthogonal()
This function returns a boolean value that indicates if the point array for the oaPath is orthogonal。
Python 示例
from oapy._oa import _design
# assume obj is a oaPath
obj.isOrthogonal()
obj.setWidth(width)
绑定状态: 已绑定
Python 调用: obj.setWidth(width)
This function sets the width of the oaPath to the specified value。
参数
width: The width value of the oaPath, in database units。
Python 示例
from oapy._oa import _design
# assume obj is a oaPath
obj.setWidth(width)
obj.setPoints(points)
绑定状态: 已绑定
Python 调用: obj.setPoints(points)
This function sets the points of the oaPath with the specified point array。 The point array is first compressed to remove collinear and coincident points, then is checked to verify that at least two points remain。
参数
points: A point array that defines the centerline of the oaPath。
异常
oacPathHasExtraPoints。oacPathTooFewPoints。
Python 示例
from oapy._oa import _design
# assume obj is a oaPath
obj.setPoints(points)
obj.setStyle(style)
绑定状态: 已绑定
Python 调用: obj.setStyle(style)
This function sets the oaPathStyle value。
Python 示例
from oapy._oa import _design
# assume obj is a oaPath
obj.setStyle(style)
obj.setBeginExt(beginExt)
绑定状态: 已绑定
Python 调用: obj.setBeginExt(beginExt)
This function sets the beginning extension for an oaPath that has the oacVariablePathStyle。
参数
beginExt: The value of the beginning extension for the oaPath, in database units。
异常
oacInvalidPathExtensionValue。
Python 示例
from oapy._oa import _design
# assume obj is a oaPath
obj.setBeginExt(beginExt)
obj.setEndExt(endExt)
绑定状态: 已绑定
Python 调用: obj.setEndExt(endExt)
This function sets the ending extension for the oaPath to the specified value。
参数
endExt: The value of the ending extension for the oaPath in database units。
异常
oacInvalidPathExtensionValue。
Python 示例
from oapy._oa import _design
# assume obj is a oaPath
obj.setEndExt(endExt)
obj.convertToPolygon()
绑定状态: 已绑定
Python 调用: obj.convertToPolygon()
This function converts this path object to a polygon object。 The resulting polygon is equivalent to the outline of the path。 All path attributes are discarded after the object conversion is complete。 Pointers to the path are still valid, but point to the new polygon。
Python 示例
from oapy._oa import _design
# assume obj is a oaPath
obj.convertToPolygon()
_design.oaPath.create(block, layerNum, purposeNum, width, points, style=oacTruncatePathStyle, beginExt=0, endExt=0)
绑定状态: 已绑定
Python 调用: _design.oaPath.create(block, layerNum, purposeNum, width, points, style=oacTruncatePathStyle, beginExt=0, endExt=0)
This function creates an oaPath object with the given attributes。 The specified pointArray is checked to verify that there are at least two points and no collinear or coincident points。 The begin or end extension arguments must be both zero if the style is not variable。
参数
block: The block in which the oaPath is created。layerNum: The number of the layer on which the oaPath is created。purposeNum: The number of the layer purpose for the oaPath。width: The oaPath width。points: The array of points for the oaPath。style: An enum value that defines the oaPath style。beginExt: The beginning extension of the oaPath; this value must be 0 (zero) for styles other than oacVariablePathStyle。endExt: The ending extension of the oaPath; this value must be 0 (zero) for styles other than oacVariablePathStyle。
异常
oacPathTooFewPoints。oacPathHasExtraPoints。oacInvalidPathExtensionValue。
Python 示例
from oapy._oa import _design
_design.oaPath.create(block, layerNum, purposeNum, width, points, style=oacTruncatePathStyle, beginExt=0, endExt=0)
_design.oaPath.genBoundary(points, width, style, beginExt, endExt, boundary)
绑定状态: 已绑定
Python 调用: _design.oaPath.genBoundary(points, width, style, beginExt, endExt, boundary)
This function constructs a boundary with the polygonal outline of the path using the specified parameters。 This function is useful for determining what a path overlaps before the path is actually created。 Another common use is to render the outline of a path before the path is created。
参数
points: The points that define the centerline of the oaPath。width: The oaPath width。style: The oaPath style (an enum value between zero and four)。beginExt: The beginning extension of the oaPath。endExt: The ending extension of the oaPath。boundary: The generated boundary point array。
异常
oacPathTooFewPoints。
Python 示例
from oapy._oa import _design
_design.oaPath.genBoundary(points, width, style, beginExt, endExt, boundary)