Changeset 322 for cpp/frams


Ignore:
Timestamp:
02/01/15 17:45:07 (10 years ago)
Author:
Maciej Komosinski
Message:

Temporary fix for div by 0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/model/geometry/meshbuilder.cpp

    r286 r322  
    599599                GeometryUtils::getNextEllipseSegmentationPoint(d, scale.y, scale.x, edge.y, edge.x);
    600600                edge.z = scale.z * sqrt(1.0 - (edge.y*edge.y) / (scale.y*scale.y));
    601                 limit.z = edge.z*edge.z / sqrt(edge.x*edge.x + edge.z*edge.z);
     601                double denom=sqrt(edge.x*edge.x + edge.z*edge.z);
     602                limit.z = denom==0 ? 99999999 : edge.z*edge.z / denom; //temporary fix FIXME http://www.framsticks.com/trac/framsticks/ticket/42
    602603                area = Pt3D(edge.x, edge.y, 0.0);
    603604               
Note: See TracChangeset for help on using the changeset viewer.