(faceCountour, faceHeight, faceWidth)
| 153 | } |
| 154 | |
| 155 | export function generateMouthShape2(faceCountour, faceHeight, faceWidth) { |
| 156 | // generate a random center |
| 157 | var center = [randomFromInterval(-faceWidth / 8, faceWidth / 8), randomFromInterval(faceHeight / 4, faceHeight / 2.5)] |
| 158 | |
| 159 | var mouthPoints = getEggShapePoints(randomFromInterval(faceWidth / 4, faceWidth / 10), randomFromInterval(faceHeight / 10, faceHeight / 20), 0.001, 50); |
| 160 | var randomRotationDegree = randomFromInterval(-Math.PI / 9.5, Math.PI / 9.5) |
| 161 | for (var i = 0; i < mouthPoints.length; i++) { |
| 162 | // rotate the point |
| 163 | var x = mouthPoints[i][0] |
| 164 | var y = mouthPoints[i][1] |
| 165 | mouthPoints[i][0] = x * Math.cos(randomRotationDegree) - y * Math.sin(randomRotationDegree) |
| 166 | mouthPoints[i][1] = x * Math.sin(randomRotationDegree) + y * Math.cos(randomRotationDegree) |
| 167 | mouthPoints[i][0] += center[0] |
| 168 | mouthPoints[i][1] += center[1] |
| 169 | } |
| 170 | return mouthPoints; |
| 171 | } |
nothing calls this directly
no test coverage detected