1
0
mirror of https://github.com/Pomax/BezierInfo-2.git synced 2025-08-30 11:40:27 +02:00

Merge pull request #120 from mashabow/coord

[ja-JP, zh-CN] Fix pseudocode in flattening
This commit is contained in:
Mike Kamermans
2017-08-15 08:12:16 -07:00
committed by GitHub
2 changed files with 8 additions and 8 deletions

View File

@@ -30,11 +30,11 @@ function flattenCurve(curve, segmentCount):
```
function drawFlattenedCurve(curve, segmentCount):
coordinates = flattenCurve(curve, segmentCount)
coord = coordinates[0], _coords;
coord = coordinates[0], _coord;
for(i=1; i < coordinates.length; i++):
_coords = coordinates[i]
line(coords, _coords)
coords = _coords
_coord = coordinates[i]
line(coord, _coord)
coord = _coord
```
先頭の座標を参照点にしてスタートし、あとはそれぞれの点からその次の点へと、直線を引いていくだけです。

View File

@@ -30,11 +30,11 @@ function flattenCurve(curve, segmentCount):
```
function drawFlattenedCurve(curve, segmentCount):
coordinates = flattenCurve(curve, segmentCount)
coord = coordinates[0], _coords;
coord = coordinates[0], _coord;
for(i=1; i < coordinates.length; i++):
_coords = coordinates[i]
line(coords, _coords)
coords = _coords
_coord = coordinates[i]
line(coord, _coord)
coord = _coord
```
我们将第一个坐标作为参考点,然后在相邻两个点之间画线。