mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 08:46:55 +08:00
1 parent
e78ea6f919
commit
3b9f88cbba
16 files changed
+383
-43
No files matched your search
@@ -24,6 +24,31 @@ import (
|
||||
// 坐标以左上角为原点,单位为毫米,子路径从Move开始,Close回到当前子路径起点
|
||||
type GeometryPath []GeometrySegment
|
||||
|
||||
// stationaryEndpoint 判断贝塞尔曲线端点是否具有零一阶导数
|
||||
// 返回: bool 是否存在驻点端点
|
||||
func (p GeometryPath) stationaryEndpoint() bool {
|
||||
var current, start Point
|
||||
for _, segment := range p {
|
||||
switch segment.Verb {
|
||||
case GeometryMove:
|
||||
start = segment.End
|
||||
case GeometryCubic:
|
||||
if segment.Control1 == current || segment.Control2 == segment.End {
|
||||
return true
|
||||
}
|
||||
case GeometryQuad:
|
||||
if segment.Control1 == current || segment.Control1 == segment.End {
|
||||
return true
|
||||
}
|
||||
case GeometryClose:
|
||||
current = start
|
||||
continue
|
||||
}
|
||||
current = segment.End
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// GeometryVerb 表示几何路径指令
|
||||
type GeometryVerb uint8
|
||||
|
||||
|
||||
Reference in new issue
Block a user