Skip to content

Commit

Permalink
properly label third vanishing point control
Browse files Browse the repository at this point in the history
  • Loading branch information
stuffmatic committed Jun 21, 2018
1 parent 49e78be commit a69b7e3
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 21 deletions.
35 changes: 25 additions & 10 deletions assets/master/lettersandnumbers.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 62 additions & 9 deletions src/gui/components/control-points-panel/glyph-paths.tsx
Expand Up @@ -8,15 +8,15 @@ const glyphPaths = {
figure1: [
[
[
-0.14017857500000003,
-0.2017857499999991
-0.1709821374999999,
-0.17589274999999988
],
[
0.14017857500000003,
0.17098213750000008,
-0.5
],
[
0.14017857500000003,
0.17098213750000008,
0.5
]
]
Expand All @@ -36,8 +36,8 @@ const glyphPaths = {
-0.5
],
[
0.1616765309894487,
-0.44311359142521106
0.1743789460156247,
-0.42194266260127244
],
[
0.25449087314016877,
Expand All @@ -61,6 +61,46 @@ const glyphPaths = {
]
]
],
figure3: [
[
[
-0.2996154278146203,
-0.5
],
[
0.29947643427758486,
-0.5
],
[
-0.0047942240463503425,
-0.1229716069431239
],
[
0.23889560976979463,
-0.0032272708127613968
],
[
0.3039342892843939,
0.23476335999326287
],
[
0.19365929735725046,
0.4326920286972525
],
[
-0.010173320728757339,
0.5
],
[
-0.19275115944945523,
0.423699334047801
],
[
-0.3039342892843946,
0.2220440473794813
]
]
],
x: [
[
[
Expand Down Expand Up @@ -150,8 +190,8 @@ function glyph(glyphPath: number[][][], position: Point2D, height: number, color

return (
<Group>
{scaled.map((path) => {
return (<Line points={path} strokeWidth={1} stroke={color} />)
{scaled.map((path, i) => {
return (<Line key={i} points={path} strokeWidth={1} stroke={color} />)
})}
</Group>
)
Expand All @@ -177,6 +217,19 @@ export function axisGlyph(axis: Axis, position: Point2D, height: number) {
}

export function numberGlyph(num: number, color: string, position: Point2D, height: number) {
let glyphPath = num == 1 ? glyphPaths.figure1 : glyphPaths.figure2
let glyphPath: number[][][] = []
switch (num) {
case 1:
glyphPath = glyphPaths.figure1
break
case 2:
glyphPath = glyphPaths.figure2
break
case 3:
glyphPath = glyphPaths.figure3
break
default:
break
}
return glyph(glyphPath, position, height, color)
}
4 changes: 2 additions & 2 deletions tools/letters_and_numbers_paths.py
Expand Up @@ -3,7 +3,7 @@

dom = parse('assets/master/lettersandnumbers.svg')
groups = dom.getElementsByTagName('g')
group_ids = ['gx', 'gy', 'gz', 'g1', 'g2']
group_ids = ['gx', 'gy', 'gz', 'g1', 'g2', 'g3']
coord_lists_by_id = {}
for group in groups:
id = group.attributes['id'].value
Expand All @@ -16,9 +16,9 @@
coord_lists = []
paths = group.getElementsByTagName('path')
for path in paths:
print ' processing subpath'
coords = []
d = path.attributes['d'].value
print ' processing subpath', d
parts = d.split(' ')
for part in parts:
if len(part.split(',')) == 2:
Expand Down

0 comments on commit a69b7e3

Please sign in to comment.