Skip to content
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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

creaktive
Copy link
Contributor

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:

hyperbolic-tiling-p6-q6

@@ -152,7 +152,7 @@ class Main {

console.time("Generate Tiling");
const tiling = new RegularHyperbolicTesselation(this.spec).generateTiling(
false
true
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enable designMode

// numDivisions = numDivisions || ( arc.arcLength > 0.001 )
// ? 2 * Math.ceil( arc.arcLength ) // currently always = 2
// : 1;
numDivisions = 3;
Copy link
Contributor Author

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 );
Copy link
Contributor Author

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 );
Copy link
Contributor Author

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

Copy link
Contributor Author

@creaktive creaktive left a 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

@creaktive creaktive marked this pull request as draft August 7, 2022 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant