-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
An attempt to subdivide each edge in 3 #11
base: main
Are you sure you want to change the base?
Conversation
@@ -152,7 +152,7 @@ class Main { | |||
|
|||
console.time("Generate Tiling"); | |||
const tiling = new RegularHyperbolicTesselation(this.spec).generateTiling( | |||
false | |||
true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enable designMode
src/utilities/createGeometries.js
Outdated
// numDivisions = numDivisions || ( arc.arcLength > 0.001 ) | ||
// ? 2 * Math.ceil( arc.arcLength ) // currently always = 2 | ||
// : 1; | ||
numDivisions = 3; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Force all edges to be subdivided in 3
@@ -129,7 +130,7 @@ function subdivideHyperbolicPolygon( polygon ) { | |||
const startPoint = subdividedEdges[2][( numDivisions - i )]; | |||
const endPoint = subdividedEdges[1][i]; | |||
// this.subdivideInteriorArc( startPoint, endPoint, i ); | |||
const newPoints = subdivideLine( startPoint, endPoint, i ); | |||
const newPoints = subdivideLine( startPoint, endPoint, numDivisions, i ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo here? Was not matching the prototype of subdivideLine()
} | ||
|
||
if ( polygon.materialIndex === 0 ) { | ||
addPositionsAndUvs( positionsA, positionAIndex, uvsA, uvAIndex ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cleanup, so that "Too many divisions!!" error is not thrown
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without these changes, numDivisions
set to >= 3 causes errors
A step into the right direction, however it is still not working. Edge still has 3 points instead of 4, however the point on the edge is where it should be, if it had 4: