Use the set precision to determine wether two straight lineto (m,l) segments have the same direction and can be collapsed
This commit is contained in:
parent
d4efcaa983
commit
20f043a17b
1 changed files with 6 additions and 2 deletions
|
|
@ -403,10 +403,14 @@ default_properties = { # excluded all properties with 'auto' as default
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def is_same_sign(a, b): return (a <= 0 and b <= 0) or (a >= 0 and b >= 0)
|
def is_same_sign(a, b):
|
||||||
|
return (a <= 0 and b <= 0) or (a >= 0 and b >= 0)
|
||||||
|
|
||||||
|
|
||||||
def is_same_slope(x1, y1, x2, y2): return y1/x1 - y2/x2 == 0
|
|
||||||
|
def is_same_slope(x1, y1, x2, y2):
|
||||||
|
diff = y1/x1 - y2/x2
|
||||||
|
return scouringContext.plus(1 + diff) == 1
|
||||||
|
|
||||||
|
|
||||||
scinumber = re.compile(r"[-+]?(\d*\.?)?\d+[eE][-+]?\d+")
|
scinumber = re.compile(r"[-+]?(\d*\.?)?\d+[eE][-+]?\d+")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue