Process a facet. Normals are not guaranteed to be present (binary yes, ascii no).
A basic IO handler for file drop (Drag-and-drop).
Example use:
var body = document.getElememtByTagName("body")[0];
var fileDrop = new FileDrop(body);
fileDrop.onFileJSONDropped(function (jsonObject) {
console.log("jsonObject", jsonObject);
});
Splitting a polygon at a self intersection results in two new polygons.
Some often-used interfaces.
Handler type for path-removed listeners.
Handler type for mouse-pointer-moved listeners.
Handler type for vertex-inserted listeners.
Handler type for vertex-removed listeners.
A type for SVG <path d="..." /> params. Example: [ 'A':string, radiusx:number, radiusy:number, rotation:number, largeArcFlag=1|0, sweepFlag=1|0, endx:number, endy:number ]
A unique identifier (UID) to tell drawables apart in a performant manner.
A simple wavefront OBJ parser.
Inspired by https://webglfundamentals.org/webgl/lessons/webgl-load-obj.html
For circle-polygon-intersection-count detection we need an epsilon to eliminate smaller precision errors.
A set of beautiful web colors (I know, beauty is in the eye of the beholder).
I found this color chart with 11 colors and think it is somewhat nice https://www.pinterest.com/pin/229965124706497134/
A mix of green shades.
This function cuts a given self-intersecting polygon into non-self-intersecting sub polygons.
The algorithm only works for non-self-overlapping polygons: Please note that the union set of the sub polygons themselves will not be disjunct if the input polyon overlaps with itself!
See this illustration for details: ./demos/27-polygon-intersection-greinerhormann/splitting-polygon-types.png
An equivalent of lodash.array_fill(...).
Remove all duplicate neighbours from the given polygon.
Imagagine a polygon: [ [0,0], [10,10], [10,10], [10,10], [20,20], [10,10], [30,30], [0,0] ]
The returned vertex array will then be: [ [10,10], [20,20], [10,10], [30,30], [0,0] ]
Duplicate neighbours (and only neightours) of a run of any length will be removed.
The polygon vertices to use.
The epsilon area to use around each vertex to check equality.
Compute the max sized inlying circle in the given convex (!) polygon - also called the convex-polygon incircle.
The function will return an object with either: the circle, and the triangle that defines the three tangent points where the circle touches the polygon.
Inspired by https://observablehq.com/@mbostock/convex-polygon-incircle https://observablehq.com/@mbostock/circle-tangent-to-three-lines
The actual convex polygon.
A pair of a circle (the incircle) and a triangle (the three points where the circle is touching the polygon).
Find all intersecting lines (indices) on the polyon that intersect the circle.
The polygon to detect the intersections on (here this is the convex hull given).
The circle to detect the intersections with.
The indices of those lines that intersect (or touch) the circle.
In an array of vertices find the first occurence of a specific vertex, using and epsilon tolerance.
The vertex array to search in.
A vertex/position to search for. This can be any x-y-tuple and does not necessarily need to be an instance of Vertex.
The epsilon tolerance to use (should be >= 0). This is a required param to avoid excessive is-undef checking if this function runs in a loop.
Contrast color algorithm by Martin Sojka's. Found at https://gamedev.stackexchange.com/questions/38536/given-a-rgb-color-x-how-to-find-the-most-contrasting-color-y/38542#38542
Internal helper function used to get 'float' properties from elements. Used to determine border withs and paddings that were defined using CSS.
This function computes the three points for the inner maximum circle lying tangential to the three subsequential lines (given by four points).
Compute the circle from that triangle by using Triangle.getCircumcircle().
Not all three lines should be parallel, otherwise the circle might have infinite radius.
LineA := [vertA, vertB] LineB := [vertB, vertC] LineC := [vertC, vertD]
The first point of the three connected lines.
The second point of the three connected lines.
The third point of the three connected lines.
The fourth point of the three connected lines.
The triangle of the circular tangential points with the given lines (3 or 4 of them).
Ported to typescript.
A matrix-fill helper function. Equivalent of lodash.array_fill(...).
A helper function to shuffle the colors into a new order.
A collection of usefull geometry utilities.
Compute the n-section of the angle – described as a triangle (A,B,C) – in point A.
The first triangle point.
The second triangle point.
The third triangle point.
The number of desired angle sections (example: 2 means the angle will be divided into two sections, means an returned array with length 1, the middle line).
An array of n-1 lines secting the given angle in point A into n equal sized angle sections. The lines' first vertex is A.
Wrap the value (e.g. an angle) into the given range of [0,max).
The value to wrap.
The max bound to use for the range.
The wrapped value inside the range [0,max).
Wrap the value (e.g. an angle) into the given range of [min,max).
The value to wrap.
The min bound to use for the range.
The max bound to use for the range.
The wrapped value inside the range [min,max).
Generated using TypeDoc
The types that can be drawn and thus added to the draw queue.