# GHL Version 3.4.4 Function List

This document lists GHL 3.4.4 functions.

## Entities and Modules

GHL 3.4.4 supports following entities.
 Pnt Point Pln Plane Vec Vector Sph Spherical surface Axp Local coordinate system Cyl Cylindrical surface Lin Line Con Conical surface Lsg Line segment (poly line) Bzs Bezier surface (polynom./rational) Cir Circle Bss Bspline surace (polynom./rational) Ell Ellipse Les Surface of linear extrusion Par Parabola Rvs Surface of revolution Hyp Hyperbola Rts Rectangular trimmed surface Bzc Bezier curve (polynom./rational) Cbs Curve bounded surface Bsc Bspline curve (polynom./rational) GS S Patch Trc Trimmed curve Cmc Composite curve

GHL 3.4.4 is supplied as following sets(2D Subset or Fullset) which are combination of above mentioned entities.

Subset name Entities
2D Subset 2D Elements(Point/Vector/Axis Placement/Curve) + Utilities
Fullset 2D Subset + 3D Elements(Point/Vector/Axis Placement/Curve/Surface)

## Geometric evaluation (2D/3D)

### Get various geometric characteristics of an geometric element

• Evaluate a curve at a parameter (position, tangent vector, curvature, principal normal, tosion)
• Evaluate a surface at a pair of parameters (position, first/second partial derivatives, principal curvatures)
• Determine the length of curve
• Determine the area of curve
• Determine the enclosing box of curve
• Get the cusp points of curve
• Get the singular points of free-form curve
• Get the inflection points of free-form curve
• Get a self-intersection of free-form curve, line segment

## Intersection/Interference (2D/3D)

### Get all the intersections of two curves

LinCirEllParHypBzcBscLsgTrcCmc
Linx---------
Cirxx--------
Ellxxx-------
Parxxxx------
Hypxxxxx-----
Bzcxxxxxx----
Bscxxxxxxx---
Lsgxxxxxxxx--
Trcxxxxxxxxx-
Cmcxxxxxxxxxx

### Get all the intersections of curve and surface

LinCirEllParHypBzcBscTrcCmc
Plnxxxxxxxxx
Sphxxxxxxxxx
Cylxxxxxxxxx
Conxxxxxxxxx
Bzsxxxxxxxxx
Bssxxxxxxxxx
Lesxxxxxxxxx
Rvsxxxxxxxxx
Cbsxxxxxxxxx

### Get all the intersections of two surfaces

PlnSphCylConBzsBssLesRvsCbs
Plnx--------
Sphxx-------
Cylxxx------
Conxxxx-----
Bzsxxxxx----
Bssxxxxxx---
Lesxxxxxxx--
Rvsxxxxxxxx-
Cbsxxxxxxxxx

### Get all the interference of two curves

Bzc Bsc Lsg Trc Cmc
Bzc x - - - -
Bsc x x - - -
Lsg - - x - -
Trc - - - x -
Cmc - - - - x
3D freeform curves are yet not supported.

Pln Bzs Bss
Pln - - -
Bzs x x -
Bss x x x

LinPln
Linx-
Plnxx

PntLin
Pntx-
Linxx

## Shortest Distance(2D)

### Get the shortest distance between a point and a curve

• Curve : Lin/Cir/Ell/Par/Hyp/Bzc/Bsc/Lsg/Trc/Cmc

### Get the shortest distance between two curves

LinCirEllParHypBzcBscLsgTrcCmc
Linx---------
Cirxx--------
Ellxxx-------
Parxxxx------
Hypxxxxx-----
Bzcxxxxxx----
Bscxxxxxxx---
Lsgxxxxxxxx--
Trcxxxxxxxxx-
Cmcxxxxxxxxxx

## Side (2D/3D)

### Judge whether a point is on other elements

• Entity : Pnt/Lin/Cir/Ell/Par/Hyp/Bzc/Bsc/Trc/Cmc/Pln
3D Bzc, Bsc, Trc and Cmc are yet not supported.

### Judge in which side of curve a point lies

• Curve : Lin/Cir/Ell/Par/Hyp/Bzc/Bsc/Trc/Cmc
3D Bzc, Bsc, Trc and Cmc are yet not supported.

## Projection (2D/3D)

### Get all the feet of perpendicular from a point to geometric element

• Curve : Lin/Cir/Ell/Par/Hyp/Bzc/Bsc/Trc/Cmc
• Surface : Pln/Sph/Cyl/Con/Bzs/Bss/Les/Rvs/Cbs

### Project a curve to a plane

• Curve : Lin/Cir/Ell/Par/Hyp/Bzc/Bsc/Lsg/Trc/Cmc

## Common Normal(2D/3D)

### Get all the common normals of two geometric elements

LinCirEllParHypBzcBscLsgTrcCmc
Linx---------
Cirxx--------
Ellxxx-------
Parxxxx------
Hypxxxxx-----
Bzcxxxxxx----
Bscxxxxxxx---
Lsgxxxxxxxx--
Trcxxxxxxxxx-
Cmcxxxxxxxxxx
Only Lin-Lin function is supported for 3D.

## Tangent (2D)

### Get all the tangential points from a point to curve

• Curve : Lin/Cir/Ell/Par/Hyp/Bzc/Bsc/Trc/Cmc

## Common tangent (2D)

### Get all the common tangents of two curves

LinCirEllParHypBzcBscTrcCmc
Linx--------
Cirxx-------
Ellxxx------
Parxxxx-----
Hypxxxxx----
Bzcxxxxxx---
Bscxxxxxxx--
Trcxxxxxxxx-
Cmcxxxxxxxxx

## Element creation (2D/3D)

• Create a line from 2 points
• Create a conic section (Cir/Ell/Par/Hyp) from 5 points
• Create a tangential circle of 3 entities(Pnt/Lin/Cir)(2D)
• Interpolate a polygon with free-form curve (Bsc)
• Approximate a polygon with free-form curve (Bzc/Bsc)
• Interpolate a polynet with free-form surface (Bss)
• Interpolate boundaries with free-from surface (Bss)
• Approximate a polynet with free-form surface (Bzs/Bss)
• Convert a curve into line-segment
• Convert a curve into rational free-form curve (Bzc/Bsc)
• Convert a surface into rational free-form surface (Bzs/Bss)
• Get an isoparametric curve of surface
• Convert a surface into set of triangle
• Convert a Bzs/Bss into grid points
• Reduce the number of segments of a Bss

## Fillet insertion (2D/3D)

### Insert fillets between two 2D geometric elements

PntLinCirEllParHypBzcBscTrc
Pntx--------
Linxx-------
Cirxxx------
Ellxxxx-----
Parxxxxx----
Hypxxxxxx---
Bzcxxxxxxx--
Bscxxxxxxxx-
Trcxxxxxxxxx

### Insert fillets between two 3D geometric elements

PntLinCirEllParHypBzcBsc
Pntx-------
Linxx------
Cirxxx-----
Ellxxxx----
Parxxxxx---
Hypxxxxxx--
Bzcxxxxxxx-
Bscxxxxxxxx
PntLinCirEllParHypBzcBsc
Plnxxxxxxxx
Sphxxxxxxxx
Cylxxxxxxxx
Conxxxxxxxx
Bzsxxxxxxxx
Bssxxxxxxxx
Lesxxxxxxxx
Rvsxxxxxxxx
Cbsxxxxxxxx
PlnSphCylConBzsBssLesRvsCbs
Plnx--------
Sphxx-------
Cylxxx------
Conxxxx-----
Bzsxxxxx----
Bssxxxxxx---
Lesxxxxxxx--
Rvsxxxxxxxx-
Cbsxxxxxxxxx

## Offsetting (2D/3D)

### Offset a geometric element

• 2D element : Pnt/Lin/Cir/Ell/Par/Hyp/Bzc/Bsc/Trc/Cmc
• 3D element : Pnt/Lin/Cir/Ell/Par/Hyp/Bzc/Bsc/Trc/Pln/Sph/Cyl/Con/Bzs/Bss/Les/Rvs/Cbs
Outcome of 2D offsetting becomes a curve, while outcome of 3D offsetting becomes a surface.

## Sweeping/Skinning(3D)

### Sweeping

Generates a surface that is a locus of a curve swept along another curve.
• input: Bsc, RBsc
• output: Bss, RBss

### Skinning

Generates a surface that interpolates a set of curves.
• input: Bsc, RBsc
• output: Bss, RBss

## Line Segment operations(2D)

• Divide a line segment into two
• Trancate a line segment
• Reverse the direction of a line segment
• Judge the direction of a closed line segment

## Freeform operations (2D/3D)

• Elevate the degree of Bzc/Bzs
• Divide a Bzc/Bzs into two
• Get the monomial form of Bzc
• Evaluate Bernstein functions at a parameter
• Elevate the degree of Bsc/Bss
• Insert a knot into Bsc/Bss
• Divide a Bsc/Bss into two
• Convert a Bsc/Bss into Bzc/Bzs
• Get the monomial form of Bsc
• Evaluate Bspline functions at a parameter
• Get the index of a Bspline segment that includes a given parameter
• Get the value of i-th knot
• Blossoming
• Judge whether a Bzs is planar or not
• etc.

## Composite Curve operations(2D/3D)

• Add a trimmed curve at the end of a composite curve
• Count the number of trimmed curve in a composite curve
• Return the i-th trimmed curve in a composite curve
• Add a trimmed curve at a given point of a composite curve
• Get the segment of a composite curve
• remove self-intersection of closed composite curve(2D)
• set operation of closed composite curve(2D)
• etc.

## Pseudo embedded graph(2D)

• add vertices/edges/faces into a pseudo embedded graph
• remove vertices/edges/faces from a pseudo embedded graph
• attach arbitrary data to a vertex/edge/face
• call specified function for each of vertices/edges/faces
• etc.

## Voronoi diagram / Delaunay diagram(2D)

• generate Voronoi/Delaunay diagram for a set of points
• attach arbitrary data to a vertex/edge/face
• etc.

## Set of triangles(2D/3D)

• generate a triangulation for a set of points
• attach arbitrary data to a vertex/edge/face
• call specified function for each of vertices/edges/faces
• etc.

## (closed) Polygon(2D)

• judge whether a set of points is included by a closed polygon or not
• determine the loop-wise (CW/CCW) of closed polygon
• do set operation (sum/intersection) for 2 closed polygons
• etc.

## S-patch(3D)

S-patch is multi-sided surface patch.
• Allocate an empty s-patch
• Approximate s-patch with Set of Triangle
• Approximate s-patch with Bezier Surfaces
• Evaluate s-patch
• Create Gregory s-patch
• Free s-patch
• Depth elevation for normal s-patch
• Get normal vector of s-patch

## Printing(2D/3D)

• Set/Get the function for printing a string
• Set/Get the number of decimal columns for floating point numbers
• Print the type of entity
• Print the definition of entity

## Coordinate transformation (2D/3D)

• Transform a point/vector into enclosing coordinate system
• Transform a point/vector into local coordinate system
GHL deals with only Euclidean right-hand orthogonal coordinate systems.

## Vector operation (2D/3D)

• Get the norm of vector
• Unitize a vector
• Get the sum/difference/dot product/cross product of two vectors
• Sum vectors with weights
• Generate a vector which is perpendicular with a given vector

## Equation

• Solve a quadric equation (real, complex)
• Solve n-th degree equation by Durand-Kerner method (complex)
• Solve n-th degree equation by Newton-Raphson method (real, complex)
• Solve simultaneous non-linear equations by Newton-Raphson method
• Integrate the specified function over finite interval

## Polynomial

• Cross product of position and 1st derivative of a vector polynomial
• Cross product of 1st and 2nd derivatives of a vector polynomial
• Evaluate a real polynomial
• Evaluate a complex polynomial
• Multiply a polynomial by another polynomial
• Transform a vector polynomial into [0, 1] unit parameter section

## Matrix

• LU-decomposition of N * N matrix
• Solver of LU-decomposed linear equations
• Compute linear least square solutions

## Others

• Array management
• List management
• Binary-Tree/N-ary-Tree management
• Initialize various tolerance values
• Judge whether given points are collinear or not
• Judge whether given points are coplanar or not
• Translate a geometric element
• Rotate a geometric element
• Extend/contract a geometric element
• Convert a vector into slope angle in radian
• Normalize angle into [(0, 2pi)]
• Maximum/Minimum value in the arguments
• Coefficient of Pascal triangle
• Greatest Common Divider, Least Common Multiple
• etc.