DFNgen
2.0
DFN Model Generator
|
Go to the source code of this file.
Functions | |
void | createBoundingBox (struct Poly &newPoly) |
void | printBoundingBox (struct Poly &newPoly) |
bool | checkBoundingBox (struct Poly &poly1, struct Poly &poly2) |
struct IntPoints | findIntersections (short &flag, struct Poly &poly1, struct Poly &poly2) |
int | FRAM (struct IntPoints &intPts, unsigned int count, std::vector< IntPoints > &intPtsList, struct Poly &newPoly, struct Poly &poly2, struct Stats &pstats, std::vector< TriplePtTempData > &tempData, std::vector< Point > &triplePoints, std::vector< IntPoints > &tempIntPts) |
int | intersectionChecking (struct Poly &newPoly, std::vector< Poly > &acceptedPoly, std::vector< IntPoints > &intpts, struct Stats &pstats, std::vector< Point > &triplePoints) |
double | pointToLineSeg (const double *point, const double *line) |
double | pointToLineSeg (const Point &point, const double *line) |
bool | checkDistanceFromNodes (struct Poly &poly, IntPoints &intPts, double minSize, Stats &pstats) |
bool | checkCloseEdge (Poly &poly1, IntPoints &intPts, double shrinkLimit, Stats &pstats) |
double | lineSegToLineSeg (const double *line1, const double *line2, Point &pt) |
double | lineSegToLineSegSep (const double *line1, const double *line2) |
Point | lineIntersection3D (const double *p1, double *v1, const double *p2, double *v2) |
bool | checkDistIntPtsEdge (struct PointList &tmpPoints, struct Poly &newPoly, struct Poly &poly2) |
void | applyRotation2D (struct Poly &newPoly, float angle) |
void | applyRotation3D (struct Poly &newPoly, double *normal) |
void | translate (Poly &newPoly, double *translation) |
int | checkForTripleIntersections (IntPoints &intPts, unsigned int count, std::vector< IntPoints > &intPtsList, Poly &newPoly, Poly &poly2, std::vector< TriplePtTempData > &tempData, std::vector< Point > &triplePoints) |
struct IntPoints | polyAndIntersection_RotationToXY (struct IntPoints &intersection, Poly &newPoly, std::vector< Point > &triplePoints, std::vector< Point > &tempTripPts) |
double * | rotationMatrix (double *normalA, double *normalB) |
bool | shrinkIntersection (IntPoints &intPts, double *edge, double shrinkLimit, double firstNodeMinDist, double minDist) |
bool | checkDistToOldIntersections (std::vector< IntPoints > &intPtsList, IntPoints &intPts, Poly &poly2, double minDistance) |
bool | checkDistToNewIntersections (std::vector< IntPoints > &tempIntPts, IntPoints &intpts, std::vector< TriplePtTempData > &tempTripPts, double minDistance) |
bool | PointOnLineSeg (const Point &pt, const double *line) |
bool | PointOnLineSeg (const double *pt, const double *line) |
void applyRotation2D | ( | Poly & | newPoly, |
float | angle | ||
) |
Rotates poly around its normal vecotor on x-y plane Assumes poly is on x-y plane Assumes poly.numberOfNodes is set Angle must be in radians Arg 1: Poly to be rotated Arg 2: Angle to rotate to
Definition at line 24 of file computationalGeometry.cpp.
void applyRotation3D | ( | Poly & | newPoly, |
double * | normalB | ||
) |
Rotates 'newPoly' from newPoly's current normal so that newPoly's new normal will be 'normalB' Assumes poly.numberOfPoints and newPoly.normal are initialized and normalized Arg 1: Poly to be rotated Arg 2: Normal vector to rotate to (array of 3 doubles)
Definition at line 147 of file computationalGeometry.cpp.
Compares two polygons' bounding boxes, returns 1 if bounding boxes intersect Arg 1: Poly 1 Arg 2: Poly 2 Return: True if bounding box's intersect, false otherwise
Definition at line 379 of file computationalGeometry.cpp.
Checks distances from intersection to poly edges. If the distance is less than h, the intersection is allowed to shrink by %10 of its original length. If the intersection is still closer than h to a poly edge, the polygon is rejected.
Arg 1: Poly to be tested Arg 2: IntPoints intersection to be tested Arg 3: Minimum length the intersection is allowed to shinrk to Arg 4: Stats program statistics structure, used to report stats on how much intersection length is being reduced by from shrinkIntersection()
Definition at line 1197 of file computationalGeometry.cpp.
bool checkDistanceFromNodes | ( | struct Poly & | poly, |
IntPoints & | intPts, | ||
double | minDist, | ||
Stats & | pstats | ||
) |
Checks distance from line of intersection to poly vertices Arg 1: Poly to check dist to intersection Arg 3: Intersection structure (intersection end points) Arg 4: Minimum distance allowed Return: 0 - Distance from intersection to vertices are all > 'minDist' 1 - Na distance less than minDist was found
Definition at line 1022 of file computationalGeometry.cpp.
bool checkDistIntPtsEdge | ( | struct PointList & | tmpPoints, |
struct Poly & | newPoly, | ||
struct Poly & | poly2 | ||
) |
bool checkDistToNewIntersections | ( | std::vector< IntPoints > & | tempIntPts, |
IntPoints & | intPts, | ||
std::vector< TriplePtTempData > & | tempTriPts, | ||
double | minDistance | ||
) |
Checks distance of new intersection to other intersections on newPoly Arg 1: Array of intersections previously found on newPoly Arg 2: Current intersection being checked, intersection between newPoly and poly2 Arg 3: Temp triple points, triple points found on newPoly Arg 4: Minimum distance allowed if not a triple intersection Return: 0 if no all distances are larger than minDistance or minDistance = 0 with triple intersection point 1 Otherwise NOTE: If the distance between two intersections is 0, this function will verify the that the triple interersection exists in 'tempTriPts'. If not found, fracture will be rejected Due to the shrinkIntersection algorithm, it may be possible for a triple intersection point to exist on only one fracture. This check resolves this issue.
Definition at line 712 of file computationalGeometry.cpp.
bool checkDistToOldIntersections | ( | std::vector< IntPoints > & | intPtsList, |
IntPoints & | intPts, | ||
Poly & | poly2, | ||
double | minDistance | ||
) |
Checks distance of new intersection to intersections on poly2 Arg 1: Intersections arry for entire DFN Arg 2: Current intersection being checked, intersection between newPoly and poly2 Arg 3: Poly2 Arg 4: Minimum distance allowed if not a triple intersection Return: 0 if no all distances are larger than minDistance or minDistance = 0 with triple intersection point 1 Otherwise
Definition at line 680 of file computationalGeometry.cpp.
int checkForTripleIntersections | ( | IntPoints & | intPts, |
unsigned int | count, | ||
std::vector< IntPoints > & | intPtsList, | ||
Poly & | newPoly, | ||
Poly & | poly2, | ||
std::vector< TriplePtTempData > & | tempData, | ||
std::vector< Point > & | triplePoints | ||
) |
Check for triple intersection features of less than h. Returns rejection code if fracture is rejected, zero if accepted
Rejection codes: 0 = poly accepted -10 = triple_intersectionsNotAllowed (rejected triple intersections due to triple intersections not allowed in input file) -11 = triple_closeToIntersection (newPoly's intersection landed too close to a previous intersection) -12 = triple_smallIntersectionAngle -13 = triple_closeEndPoint (triple intersection point too close to an endpoint) -14 = triple_closeToTriplePt (new triple point too close to previous triple point)
Definition at line 1412 of file computationalGeometry.cpp.
void createBoundingBox | ( | struct Poly & | newPoly | ) |
Creates bounding box for polygon/fracture Sets bounding box in poly struct Arg 1: Poly to create and set bounding box for
Definition at line 322 of file computationalGeometry.cpp.
Finds intersection end points of two intersecting polygons (Poly 1 and Poly 2) Or, finds that polygons do not intersect (flag will = 0 ) Arg 1: OUTPUT, flag (see definitions below) Arg 2: Poly 1 Arg 3: Poly 2 Return: Intersection end points, Valid only if flag != 0
Definition at line 399 of file computationalGeometry.cpp.
int FRAM | ( | IntPoints & | intPts, |
unsigned int | count, | ||
std::vector< IntPoints > & | intPtsList, | ||
Poly & | newPoly, | ||
Poly & | poly2, | ||
Stats & | pstats, | ||
std::vector< TriplePtTempData > & | tempData, | ||
std::vector< Point > & | triplePoints, | ||
std::vector< IntPoints > & | tempIntPts | ||
) |
Checks new poly and new intersection against other intersecting polygons for violation of minimum feature size 'h' In some cases, the intersection may be shortened in order to accepted the fracture. Arg 1: Newest intersection found on new poly Arg 2: OUTPUT, counter of number of intersections on new poly Arg 3: Intersection endpoints list for entire DFN Arg 4: New poly, poly being checked with FRAM Arg 5: Poly which new poly intersects with Arg 6: Stats structure (Should only be one, singleton) Arg 7: OUTPUT, reject code if FRAM rejects fracture Arg 8: Temp triple point data. Must keep intersections and triple points as temp data untill newPoly has been accepted Arg 9: Triple points for entire DFN Arg 10: Temp intersection points. Must keep intersections and triple points as temp data untill newPoly has been accepted Return: 0 (False) if accepted, 1 (True) if rejected
Definition at line 607 of file computationalGeometry.cpp.
int intersectionChecking | ( | struct Poly & | newPoly, |
std::vector< Poly > & | acceptedPoly, | ||
std::vector< IntPoints > & | intPtsList, | ||
struct Stats & | pstats, | ||
std::vector< Point > & | triplePoints | ||
) |
This function will check for intersections with all polys whos bounding boxes intersect. It also will run FRAM on the intersections. 'newPoly' will be checked with FRAM one intersection at a time. At the first FRAM rejection, further intersection checking will be aborted and the poly will be retranslated or thrown away. This function saves intersections, and updates cluster groups when a poly is accepted. This functino returns 0 if the poly was accepted and 1 if rejected. User needs to push the newPoly into the accepted poly array if this function returns 0
Arg 1: Polygon being tested (newest poly to come into the DFN) Arg 2: Array of all accepted polygons Arg 3: Array of all accepted intersections Arg 4: Program statistics structure Arg 5: OUTPUT, reject code if fracture is rejected Arg 6: Array of all accepted triple intersection points Return: 0 - Fracture had no intersections or features violating the minimum feature size h (Passed all FRAM tests) 1 - Otherwise
Definition at line 870 of file computationalGeometry.cpp.
Point lineIntersection3D | ( | const double * | p1, |
double * | v1, | ||
const double * | p2, | ||
double * | v2 | ||
) |
Used in lineSegToLineSeg() Arg 1: First end point for line 1 Arg 2: Array of 3 doubles. Vecotor from second end point on line 1 to p1 (first end point) Arg 3: First end point for line 2 Arg 4: Array of 3 doubles. Vecotor from second end point on line 2 to p2 (first end point) Return: Point structure of interseciton point if intersections do in fact intersect. (in lineSegToLineSeg(), intersection is verified by pointOnLineSeg())
Definition at line 1302 of file computationalGeometry.cpp.
double lineSegToLineSeg | ( | const double * | line1, |
const double * | line2, | ||
Point & | pt | ||
) |
Calculates the distance between two line segments. Also calculates the point of intersection if the lines overlap.
Arg 1: Array of 6 doubles for line 1 end points: {x1, y1, z1, x2, y2, z2} Arg 2: Array of 6 doubles for line 2 end points: {x1, y1, z1, x2, y2, z2} Arg 3: OUTPUT. Point structure object. If lines intersect, pt will contain the intersection point. Return: Minimum distance between line 1 and line 2
Definition at line 1338 of file computationalGeometry.cpp.
double lineSegToLineSegSep | ( | const double * | line1, |
const double * | line2 | ||
) |
Calculates the minimum distance between two seperated line segments.
Arg 1: Array of 6 doubles for line 1 end points: {x1, y1, z1, x2, y2, z2} Arg 2: Array of 6 doubles for line 2 end points: {x1, y1, z1, x2, y2, z2} Return: Minimum distance between 'line1' and 'line2'
Definition at line 1389 of file computationalGeometry.cpp.
bool PointOnLineSeg | ( | const Point & | pt, |
const double * | line | ||
) |
bool PointOnLineSeg | ( | const double * | pt, |
const double * | line | ||
) |
double pointToLineSeg | ( | const double * | point, |
const double * | line | ||
) |
Arg 1: Point in 3D space (array of three doubles) Arg 2: Line (array of 6 doubles. Enpoint 1 and end point 2: {x1, y1, z1, x2, y2, z2} Return: Returns the shortest distance between the point and the line segment
Definition at line 1054 of file computationalGeometry.cpp.
double pointToLineSeg | ( | const Point & | point, |
const double * | line | ||
) |
Arg 1: Point structure. Point in 3D space Arg 2: Line (array of 6 doubles. Enpoint 1 and end point 2: {x1, y1, z1, x2, y2, z2} Return: Returns the shortest distance between the point and the line segment
Definition at line 1079 of file computationalGeometry.cpp.
struct IntPoints polyAndIntersection_RotationToXY | ( | struct IntPoints & | intersection, |
Poly & | newPoly, | ||
std::vector< Point > & | triplePoints, | ||
std::vector< Point > & | tempTripPts | ||
) |
Rotates intersections to x-y plane, including triple intersection points. While doing this, if poly is not already on x-y plane, poly will also be rotated to x-y plane. Doing these all at once keeps us from having to re-calulate rotation matricies, or cary them in memory, increasing performance Return rotated intersectoins - don't change original intersections Original, non-rotated intersections are need to rotate to the other intersecting polys Function is used to wrtie intersection.inp output files Arg 1: Intersection, belonging to newPoly(arg 2), to be rotated Arg 2: Poly which is being rotated (OK if already on x-y plane) Arg 3: Vecor array of all triple intersection points in DFN Arg 4: OUTPUT, Array to place rotated triple intersection points Because triple intersection points are rotated 3 different ways, we must preserve the original points. Return: Rotated version of intersection passed in arg 1
Definition at line 207 of file computationalGeometry.cpp.
void printBoundingBox | ( | struct Poly & | newPoly | ) |
Bounding box print out to std out. Arg 1: Poly whos bounding box to print to screen.
Definition at line 365 of file computationalGeometry.cpp.
double* rotationMatrix | ( | double * | normalA, |
double * | normalB | ||
) |
Returns rotation matrix (double, 3x3) of rotation from normalA to normalB Requires normals to be normalized
Expects normalA and normalB to be normalized.
Arg1: double pointer to normalA, array of 3 doubles Arg2: double pointer to normalB, array of 3 doubles Return: pointer to 3x3 rotation matrix array NOTE: Must manually delete reurn pointer with delete[]
Definition at line 73 of file computationalGeometry.cpp.
bool shrinkIntersection | ( | IntPoints & | intPts, |
double * | edge, | ||
double | shrinkLimit, | ||
double | firstNodeMinDist, | ||
double | minDist | ||
) |
Shrinks intersection untill the intersection is greater than 'minDist to 'edge', or intersection shrinks to length < 'shrinkLimit'
'firstNodeMinDist' can be used to allow a shoter first discretized node distance. This allows for slight angles for intersections starting on the edges of polygons without there the intersection being shortened. If the first node is of distnace smaller than 'firstNodeMinDist', the 'minDist' will be used from this point on to shorten the intersection.
Arg 1: Intersection being shrunk Arg 2: Double array[6] of two end points which intersection is being tested against Arg 3: Minimum length intersection is allowed to shrink Arg 4: Fist node minimum distance Arg 5: Minimum allowed distance between intersection and edge Return: 0 If intersection successfully shortened and minDist <= dist to edge && shrinkLimit <= intersection length 1 If intersection length shrinks to less than shrinkLimit
Definition at line 770 of file computationalGeometry.cpp.
void translate | ( | Poly & | newPoly, |
double * | translation | ||
) |
Translates 'newPoly' to 'translation' Assumes newPoly.numberOfNodes is initialized Arg 1: Polygon to translate Arg 2: translation (new x,y,z position) double[3] array
Definition at line 47 of file computationalGeometry.cpp.