Ignore:
Timestamp:
Aug 10, 2009, 4:11:47 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
ada6d2
Parents:
0cf171
Message:

New function ConvexizeNonconvexEnvelope() to calculate the volume of a non-convex envelope.

The central idea is that the volume of a convex envelope is easy to determine as a sum of pyramids with respect to a center inside the envelope. Hence, if we can "reduce" the non-convex envelope to a convex one in such a way that we know the added volume, we may determine the volume of a non-convex envelope.
The nice side effect is that we may use our Find_non_convex_border() algorithm to calculate also the convex envelope.

  • We go through all BoundaryPoints and check whether one of its Baselines does not fulfill the ConvexCriterion. If so, we remove it, as it can not be a boundary point on the convex envelope, and re-construct the attached triangles. The added volume is a general tetraeder, whose formula is known.
  • FIX: Find_convex_border() - We check whether AddPoint is successful or not.
  • builder.cpp: case 'o' - changed to use ConvexizeNonconvexEnvelope() instead of Find_convex_border()
  • Tesselation:AddPoint() - now takes second argument which is the index for BPS and always set BPS to either the newly created or the already present point. Return argument discerns between new and already present point.
  • Tesselation::BPS, BLS, BTS are now public not private. We have to access them from ConvexizeNonconvexEnvelope()
File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/tesselation.hpp

    r0cf171 r70c4567  
    190190    virtual ~Tesselation();
    191191
    192     void AddPoint(TesselPoint *Walker);
     192    bool AddPoint(TesselPoint *Walker, int n);
    193193    void AddTrianglePoint(TesselPoint* Candidate, int n);
    194194    void AddTriangleLine(class BoundaryPointSet *a, class BoundaryPointSet *b, int n);
     
    236236    virtual bool IsEnd();
    237237
    238   private:
    239     class BoundaryPointSet *TPS[3]; //this is a Storage for pointers to triangle points, this and BPS[2] needed due to AddLine restrictions
    240238    class BoundaryPointSet *BPS[2];
    241239    class BoundaryLineSet *BLS[3];
    242240    class BoundaryTriangleSet *BTS;
     241
     242  private:
     243    class BoundaryPointSet *TPS[3]; //this is a Storage for pointers to triangle points, this and BPS[2] needed due to AddLine restrictions
    243244
    244245    PointMap::iterator InternalPointer;
Note: See TracChangeset for help on using the changeset viewer.