Project

General

Profile

« Previous | Next » 

Revision f4b59207

Added by Leszek Koltunski over 3 years ago

Cubit creation: bugfixes.

View differences:

src/main/java/org/distorted/examples/meshfile/FactoryCubit.java
431 431

  
432 432
  private double computeCos(double oldX, double oldY, double newX, double newY, double len1, double len2)
433 433
    {
434
    double ret =  (oldX*newX+oldY*newY) / (len1*len2);
435

  
436
    if( ret> 1.0f ) return  1.0;
437
    if( ret<-1.0f ) return -1.0;
438

  
439
    return ret;
434
    return (oldX*newX+oldY*newY) / (len1*len2);
440 435
    }
441 436

  
442 437
///////////////////////////////////////////////////////////////////////////////////////////////////
......
444 439

  
445 440
  private double computeSin(double oldX, double oldY, double newX, double newY, double len1, double len2)
446 441
    {
447
    double ret = (newX*oldY-oldX*newY) / (len1*len2);
448

  
449
    if( ret> 1.0f ) return  1.0;
450
    if( ret<-1.0f ) return -1.0;
451

  
452
    return ret;
442
    return (newX*oldY-oldX*newY) / (len1*len2);
453 443
    }
454 444

  
455 445
///////////////////////////////////////////////////////////////////////////////////////////////////
......
589 579
      {
590 580
      int oldSticker = oldInfo.sticker;
591 581
      double[] buffer1 = new double[oldLen];
592
      double lenFirstOld = Math.sqrt(newVert[0]*newVert[0] + newVert[1]*newVert[1]);
582
      double lenFirstOld = Math.sqrt(oldVert[0]*oldVert[0] + oldVert[1]*oldVert[1]);
593 583
      if( foundVertex(newInfo, buffer1, oldLen/2, newVert, oldVert, lenFirstOld, oldSticker, false) ) return true;
594 584
      double[] buffer2 = new double[oldLen];
595 585
      mirrorAllVertices(buffer2, newLen/2, newVert);

Also available in: Unified diff