Skip to content

In BuildingShapeUtils.js the edgeDirection seems to have an error: Pi/2 #72

@DerKarlos

Description

@DerKarlos

Your Comment:

  • Calculate the angle of each of a shape's edge.
  • the angle will be PI > x >= -PI

Your code:

   if (angle >= Math.PI / 2) {
        angle -= Math.PI;
   } else if (angle < -Math.PI / 2) {
        angle += Math.PI;

360 Degrees are two Pi. So it should be:

   if (angle >= Math.PI) {
        angle -= Math.PI * 2;
   } else if (angle < -Math.PI ) {
        angle += Math.PI * 2;

I used your code with https://www.openstreetmap.org/way/24771505
(while ignoring the "direction=S") There are two symmetrical skillions
and one sloped in the wrong direction until I changed your code.

By the way: Are you still interested in this project?
I consider to transcode it to Rust and extend it.
Would you like to contact me? @karlos@mindly.social
This is my actual 3D solution (with TreeJS)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions