Skip to content

Commit

Permalink
Fixed issue #1091.
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsschmidt1337 committed Jul 28, 2024
1 parent 47813ca commit 4617405
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/org/nschmidt/ldparteditor/data/GData4.java
Original file line number Diff line number Diff line change
Expand Up @@ -1264,7 +1264,10 @@ public void drawGL20WhileAddCondlines(Composite3D c3d) {
@Override
public void drawGL20CoplanarityHeatmap(Composite3D c3d) {
calculateAngle();
float f = (float) Math.min(1.0, Math.max(0, angle - Threshold.coplanarityAngleWarning) / Threshold.coplanarityAngleError);
double delta = Threshold.coplanarityAngleError - Threshold.coplanarityAngleWarning;
if (Math.abs(delta) < 0.0001) delta = 1.0;
float f = angle < Threshold.coplanarityAngleWarning ? 0f : angle >= Threshold.coplanarityAngleError ? 1f :
Math.min((float) ((angle - Threshold.coplanarityAngleWarning) / delta / 2.7 + .5), 1f);

float red = 0f;
float green;
Expand Down
5 changes: 4 additions & 1 deletion src/org/nschmidt/ldparteditor/data/GL33ModelRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -1948,7 +1948,10 @@ private void renderThread() {
pointAt(11, v[0].x, v[0].y, v[0].z, triangleData, tempIndex);

final double angle = gd4.calculateAngle();
float f = (float) Math.min(1.0, Math.max(0, angle - Threshold.coplanarityAngleWarning) / Threshold.coplanarityAngleError);
double delta = Threshold.coplanarityAngleError - Threshold.coplanarityAngleWarning;
if (Math.abs(delta) < 0.0001) delta = 1.0;
float f = angle < Threshold.coplanarityAngleWarning ? 0f : angle >= Threshold.coplanarityAngleError ? 1f :
Math.min((float) ((angle - Threshold.coplanarityAngleWarning) / delta / 2.7 + .5), 1f);

float r = 0f;
float g;
Expand Down

0 comments on commit 4617405

Please sign in to comment.