# README
Gosl. gm. Geometry algorithms and structures
This package provides some functions to help with the solution of geometry problems. It also includes some routines loosely related with geometry.
API
# Functions
DistPointBoxN returns the distance of a point to the box NOTE: If point p lies outside box b, the distance to the nearest point on b is returned.
DistPointLine computes the distance from p to line passing through a -> b.
DistPointPoint computes the unsigned distance from a to b.
DistPointPointN returns the distance between two PointN.
IsPointIn returns whether p is inside box with cMin and cMax.
IsPointInLine returns whether p is inside line passing through a and b.
NewBoxN creates a new box with given limiting coordinates L -- limits [4] or [6]: xmin,xmax, ymin,ymax, {zmin,zmax} optional.
NewBspline returns a new B-spline.
NewMetrics2d allocate new 2D metrics structure NOTE: the second order derivatives (from ddxdrr) may be nil => homogeneous grid.
NewMetrics3d allocate new 3D metrics structure NOTE: the second order derivatives (from ddxdrr) may be nil => homogeneous grid.
NewNurbs returns a new Nurbs object.
NewNurbsPatch returns new patch of NURBS tolerance -- tolerance to assume that two control points are the same.
NewNurbsPatchFromFile allocates a NurbsPatch with data from file.
NewOctree creates a new Octree L -- limits [4] or [6]: xmin,xmax, ymin,ymax, {zmin,zmax} optional.
NewPointN creats a new PointN with given coordinates; can be any number.
NewPointNdim creates a new PointN with given dimension (ndim).
NewSegment creates a new segment from a to b.
NewTransfinite2d allocates a new structure Input: B -- [4] boundary functions Bd -- [4] 1st derivative of boundary functions Bdd -- [4 or nil] 2nd derivative of boundary functions [may be nil].
NewTransfinite3d allocates a new structure Input: B -- [6] boundary functions Bd -- [6] 1st derivative of boundary functions Bdd -- [6 or nil] 2nd derivative of boundary functions [may be nil].
PointsLims returns the limits of a set of points.
VecDot returns the dot product between two vectors.
VecNew returns a new vector scaled by m.
VecNewAdd returns a new vector by adding two other vectors w := α*u + β*v.
VecNorm returns the length (Euclidean norm) of a vector.
# Variables
FactoryNurbs generates NURBS'.
FactoryTfinite generates transfinite mappings.
minimum distance between coordinates; i.e.
# Structs
BezierQuad implements a quadratic Bezier curve C(t) = (1-t)² Q0 + 2 t (1-t) Q1 + t² Q2 = t² A + 2 t B + Q0 A = Q2 - 2 Q1 + Q0 B = Q1 - Q0.
Bin defines one bin in Bins (holds entries for search).
BinEntry holds data of an entry to bin.
Bins implements a set of bins holding entries and is used to fast search entries by given coordinates.
BoxN implements a box int he N-dimensional space.
Bspline holds B-spline data Reference: [1] Piegl L and Tiller W (1995) The NURBS book, Springer, 646p.
Grid implements (2D/3D) rectangular or curvilinear grid.
Metrics holds data related to a position in a space represented by curvilinear coordinates.
Nurbs holds NURBS data
NOTE: (1) Control points must be set after a call to Init (2) Either SetControl must be called or the Q array must be directly specified
Reference: [1] Piegl L and Tiller W (1995) The NURBS book, Springer, 646p.
NurbsExchangeData holds all data required to exchange NURBS; e.g.
NurbsPatch defines a patch of many NURBS'.
Octree implements a Quad-Tree or an Oct-Tree to assist in fast-searching elements (entities) in the 2D or 3D space.
Point holds the Cartesian coordinates of a point in 3D space.
PointExchangeData holds data for exchanging control points.
PointN implements a point in N-dim space.
Segment represents a directed segment from A to B.
Transfinite maps a reference square [-1,+1]×[-1,+1] into a curve-bounded quadrilateral
B[3](r(x,y)) _,'\ B[3](r) _,' \ B[1](s(x,y)) ┌───────┐ _,' \ │ │ \ \ B[0](s)│ │B[1](s) ⇒ \ _,' s │ │ B[0](s(x,y)) \ _,' │ └───────┘ y \ _,' B[2](r(x,y)) └──r B[2](r) │ ' └──x
+----------------+ ,'| ,'| t or z ,' | ___ ,' | B[0](s,t) ↑ ,' |,'5,' [0],' | B[1](s,t) | ,' |~~~ ,' | B[2](r,t) | +'===============+' ,'| | B[3](r,t) | | ,'| | | |3| | B[4](r,s) | s or y | |2| | | |,' | B[5](r,s) +--------> | |,' +- - - | +- - - -+ ,' | ,' | ,' ,' | ,' [1] ___| ,' r or x | ,' ,'4,'| ,' | ,' ~~~ | ,' +----------------+'
NOTE: the "reference" coordinates {r,s,t} ϵ [-1,+1]×[-1,+1]×[-1,+1] are also symbolized as "u"
.
# Interfaces
Entity defines the geometric (or not) entity/element to be stored in the Octree.
# Type aliases
NurbsExchangeDataSet defines a set of nurbs exchange data.