oaSegment
模块: oapy._oa._base
导入: from oapy._oa import _base
概览
oaSegment 在 oapy 中可用,可通过 _base 模块访问。
本页汇总 oaSegment 当前在 oapy 中可用的 Python 接口。
详细说明
The oaSegment class is a utility class the represents a line segment。 It is available for general application use。 It is not used for the API of any managed class。 oaBox::overlaps can be called with an oaSegment。
构造函数
_base.oaSegment()
obj = _base.oaSegment()
_base.oaSegment(headIn, tailIn)
obj = _base.oaSegment(headIn, tailIn)
_base.oaSegment(vec, ref)
obj = _base.oaSegment(vec, ref)
方法总览
| 状态 | Python 调用 |
|---|---|
| ✅ | obj.head() |
| ✅ | obj.tail() |
| ✅ | obj.x1() |
| ✅ | obj.x2() |
| ✅ | obj.y1() |
| ✅ | obj.y2() |
| ✅ | obj.head() |
| ✅ | obj.tail() |
| ✅ | obj.x1() |
| ✅ | obj.x2() |
| ✅ | obj.y1() |
| ✅ | obj.y2() |
| ✅ | obj.set(head, tail) |
| ✅ | obj.set(vec, ref) |
| ✅ | obj.isHorizontal() |
| ✅ | obj.isVertical() |
| ✅ | obj.isOrthogonal() |
| ✅ | obj.getDeltaX() |
| ✅ | obj.getDeltaY() |
| ✅ | obj.distanceFrom2(point) |
| ✅ | obj.distanceFrom2(point, loc) |
| ✅ | obj.contains(point, includeEnds=true) |
| ✅ | obj.collinearContains(point, includeEnds=true) |
| ✅ | obj.intersects(seg, includeEnds=true) |
| ✅ | obj.intersects(seg, includeEnds, includeOverlap) |
| ✅ | obj.intersects(seg, iPt, mustIntersect=true) |
| ✅ | obj.operator==(segment) |
| ✅ | obj.operator!=(segment) |
方法说明
obj.head()
绑定状态: 已绑定
Python 调用: obj.head()
This function returns a reference to the head point of this segment。
Python 示例
from oapy._oa import _base
# assume obj is a oaSegment
obj.head()
obj.tail()
绑定状态: 已绑定
Python 调用: obj.tail()
This function returns the tail point of this segment。
Python 示例
from oapy._oa import _base
# assume obj is a oaSegment
obj.tail()
obj.x1()
绑定状态: 已绑定
Python 调用: obj.x1()
This function returns the X value of the head point of this segment。
Python 示例
from oapy._oa import _base
# assume obj is a oaSegment
obj.x1()
obj.x2()
绑定状态: 已绑定
Python 调用: obj.x2()
This function returns the X value of the tail point of this segment。
Python 示例
from oapy._oa import _base
# assume obj is a oaSegment
obj.x2()
obj.y1()
绑定状态: 已绑定
Python 调用: obj.y1()
This function returns the Y value of the head point of this segment。
Python 示例
from oapy._oa import _base
# assume obj is a oaSegment
obj.y1()
obj.y2()
绑定状态: 已绑定
Python 调用: obj.y2()
This function returns the Y value of the tail point of this segment。
Python 示例
from oapy._oa import _base
# assume obj is a oaSegment
obj.y2()
obj.head()
绑定状态: 已绑定
Python 调用: obj.head()
This function returns the head point of this segment。
Python 示例
from oapy._oa import _base
# assume obj is a oaSegment
obj.head()
obj.tail()
绑定状态: 已绑定
Python 调用: obj.tail()
This function returns the tail point of this segment。
Python 示例
from oapy._oa import _base
# assume obj is a oaSegment
obj.tail()
obj.x1()
绑定状态: 已绑定
Python 调用: obj.x1()
This function returns a reference to the X value of the head point of this segment。
Python 示例
from oapy._oa import _base
# assume obj is a oaSegment
obj.x1()
obj.x2()
绑定状态: 已绑定
Python 调用: obj.x2()
This function returns a reference to the X value of the tail point of this segment。
Python 示例
from oapy._oa import _base
# assume obj is a oaSegment
obj.x2()
obj.y1()
绑定状态: 已绑定
Python 调用: obj.y1()
This function returns a reference to the Y value of the head point of this segment。
Python 示例
from oapy._oa import _base
# assume obj is a oaSegment
obj.y1()
obj.y2()
绑定状态: 已绑定
Python 调用: obj.y2()
This function returns a reference to the Y value of the tail point of this segment。
Python 示例
from oapy._oa import _base
# assume obj is a oaSegment
obj.y2()
obj.set(head, tail)
绑定状态: 已绑定
Python 调用: obj.set(head, tail)
This function sets the segment to start at the given reference point and point along the specified vector。
参数
vec: The vector from the head。ref: The head of the segment。
Python 示例
from oapy._oa import _base
# assume obj is a oaSegment
obj.set(head, tail)
obj.set(vec, ref)
绑定状态: 已绑定
Python 调用: obj.set(vec, ref)
This function sets the segment to have the specified end points。
参数
head: The head of the segment。tail: The tail of the segment。
Python 示例
from oapy._oa import _base
# assume obj is a oaSegment
obj.set(vec, ref)
obj.isHorizontal()
绑定状态: 已绑定
Python 调用: obj.isHorizontal()
This function returns true if the slope of the segment is zero。
Python 示例
from oapy._oa import _base
# assume obj is a oaSegment
obj.isHorizontal()
obj.isVertical()
绑定状态: 已绑定
Python 调用: obj.isVertical()
This function returns true if the slope of the segment is +/- infinity。
Python 示例
from oapy._oa import _base
# assume obj is a oaSegment
obj.isVertical()
obj.isOrthogonal()
绑定状态: 已绑定
Python 调用: obj.isOrthogonal()
This function returns true if the slope of the segment is zero or +/- infinity。
Python 示例
from oapy._oa import _base
# assume obj is a oaSegment
obj.isOrthogonal()
obj.getDeltaX()
绑定状态: 已绑定
Python 调用: obj.getDeltaX()
This function returns the deltaX between the head and tail of this segment。
Python 示例
from oapy._oa import _base
# assume obj is a oaSegment
obj.getDeltaX()
obj.getDeltaY()
绑定状态: 已绑定
Python 调用: obj.getDeltaY()
This function returns the deltaY between the head and tail of this segment。
Python 示例
from oapy._oa import _base
# assume obj is a oaSegment
obj.getDeltaY()
obj.distanceFrom2(point)
绑定状态: 已绑定
Python 调用: obj.distanceFrom2(point)
This function finds the location on the segment that is closest to the specified point and returns the square of the distance from this location to the point。
参数
point: The measurement point。loc: The location on the segment。
Python 示例
from oapy._oa import _base
# assume obj is a oaSegment
obj.distanceFrom2(point)
obj.distanceFrom2(point, loc)
绑定状态: 已绑定
Python 调用: obj.distanceFrom2(point, loc)
This function returns the square of the distance from the specified point to the closest point on this segment。 This function is faster than the previous function, but does not determine the location of the point。
参数
point: The measurement point。
Python 示例
from oapy._oa import _base
# assume obj is a oaSegment
obj.distanceFrom2(point, loc)
obj.contains(point, includeEnds=true)
绑定状态: 已绑定
Python 调用: obj.contains(point, includeEnds=true)
This function returns true if the specified point lies on this segment。
参数
point: The point that must lie on the segment。includeEnds: specifies whether the ends of the segments should be included or not。
Python 示例
from oapy._oa import _base
# assume obj is a oaSegment
obj.contains(point, includeEnds=true)
obj.collinearContains(point, includeEnds=true)
绑定状态: 已绑定
Python 调用: obj.collinearContains(point, includeEnds=true)
This function returns true if the specified collinear point lies on this segment。 The flag includeEnds specifies whether the ends of the segments should be included or not。
参数
point: point to check。includeEnds: specifies whether the ends of the segments should be included or not。
Python 示例
from oapy._oa import _base
# assume obj is a oaSegment
obj.collinearContains(point, includeEnds=true)
obj.intersects(seg, includeEnds=true)
绑定状态: 已绑定
Python 调用: obj.intersects(seg, includeEnds=true)
This function finds the point of intersection between this segment and segment seg。
参数
seg: The name of the segment to intersect。iPt: The point of intersection。mustIntersect: Specifies that the point of intersection must lie on both segments。
Python 示例
from oapy._oa import _base
# assume obj is a oaSegment
obj.intersects(seg, includeEnds=true)
obj.intersects(seg, includeEnds, includeOverlap)
绑定状态: 已绑定
Python 调用: obj.intersects(seg, includeEnds, includeOverlap)
This function returns true if this segment intersects segment seg。 The flag includeEnds specifies whether the ends of the segments should be included or not。 It does this in a fast way, although it doesn't tell you where the intersection occurs。 The flag, allowOverlap, determines whether or not overlapping segments are viewed as intersecting (true = yes; false = no)。
参数
seg:includeEnds:includeOverlap:
Python 示例
from oapy._oa import _base
# assume obj is a oaSegment
obj.intersects(seg, includeEnds, includeOverlap)
obj.intersects(seg, iPt, mustIntersect=true)
绑定状态: 已绑定
Python 调用: obj.intersects(seg, iPt, mustIntersect=true)
This function returns true if this segment intersects segment seg。 This function intersects segment seg quickly, but this function does not inform you where the intersection occurs。 This function is faster than the previous function。
参数
seg: The name of the segment to intersect。includeEnds: Includes the ends of the segments。
Python 示例
from oapy._oa import _base
# assume obj is a oaSegment
obj.intersects(seg, iPt, mustIntersect=true)
obj.operator==(segment)
绑定状态: 已绑定
Python 调用: obj.operator==(segment)
Python 示例
from oapy._oa import _base
# assume obj is a oaSegment
obj.operator==(segment)
obj.operator!=(segment)
绑定状态: 已绑定
Python 调用: obj.operator!=(segment)
Python 示例
from oapy._oa import _base
# assume obj is a oaSegment
obj.operator!=(segment)