Parametrix's logo

Parametrix

Parametrix's logo Parametrix's logo Parametrix's logo Parametrix's logo
Technical drawing --- Dessin technique --- Dessin industriel --- 2D parametric designs

Geom's developer docs

Triangle

Right triangle

right_triangle.svg

Any triangle

any_triangle.svg

Arcsin returns only values within [-PI/2, PI/2]. If you use the law of sinus to get an angle, make sure this angle is acute.

Point

Point polar coordinates

point_1.svg

Basic point transforms

point_2.svg point_3.svg

Measurements between 2 points

point_4.svg

Create a point from 2 points

point_5.svg

Line

Line and X-axis

line_getAxisXIntersection.svg line_getAxisXIntersection_2.svg line_axis_x_cases.svg

Line and Y-axis

line_getAxisYIntersection.svg line_getAxisYIntersection_2.svg line_getAxisYIntersection_3.svg line_axis_y_cases.svg

Projection of origin on line

line_distanceOrig.svg

Projection of point on line

line_projectPoint.svg

Line intersection and bisector

line_intersection.svg construction_of_line_intersection_1.svg construction_of_line_intersection_2.svg

Vector

A vector is defined by its orientation and its length.

vector_definition.svg

Contour

Contour description

A Contour object defines a closed path that consists of segments and arcs. A ContourCircle object defines a circle.

arc are defined differently in canvas-js and in svg-path.

arc_definition.svg

Contour has 3 methods to define arcs.

contour_arc_definition_options.svg

Point and Stroke can be defined relative to the previous point or absolute, with cartesian or polar coordinates. Relative coordines refer to the extremity of the last segment (stroke or arc). In particular, in case of two consecutive points, the second point, if defined with relative coordinates, refers to the previous segment and not to the previous point.

addPointRP and addSegStrokeRP use relative polar coordinate. The angle of the polar coordinate is relative to the horizontal axis. It is not relative to the previous segment orientation.

contour_point_absolute_relative.svg

2-arc defined by two points and there two tangents

contour_tangential_two_arcs_requirements.svg contour_tangential_two_arcs.svg contour_tangential_two_arcs_impossible_case.svg

Contour generation

Pointed Corner

contour().addCornerPointed() does not modify the corner.

Rounded Corner

Defintion of Rounded Corner

contour().addCornerRounded(radius) replaces the peak with an arc within the angle/peak. There is one optimal solution for the problematic.

corner_rounded_stroke_stroke.svg corner_rounded_stroke_int_arc.svg corner_rounded_stroke_ext_arc.svg corner_rounded_ext_arc_ext_arc.svg corner_rounded_int_arc_ext_arc.svg corner_rounded_int_arc_int_arc.svg

Construction of Rounded Corner
method-1

The method-1 is not recommended because the line intersection can generate point very far and then deals with very big numbers.

construct_corner_rounded_stroke_stroke.svg construct_corner_rounded_stroke_int_arc.svg construct_corner_rounded_stroke_int_arc.svg construct_corner_rounded_stroke_ext_arc.svg construct_corner_rounded_stroke_ext_arc.svg construct_corner_rounded_ext_arc_ext_arc.svg construct_corner_rounded_int_arc_ext_arc.svg construct_corner_rounded_int_arc_int_arc.svg

method-2

The method-2 is more stable because of the orthogonal projection.

construct_corner_rounded_stroke_int_arc_method2.svg construct_corner_rounded_stroke_ext_arc_method2.svg

Widened Corner

Defintion of Widened Corner

contour().addCornerWidened(radius) replaces the peak with an arc around the angle/peak. There are many possibilities to fulfil the problematic. The selected solution is to have the center of the arc on the bisector of the peak-angle. If you want to widen the corner in an other way, you have to design it yourself with strokes and arcs.

Construction of Widened Corner

construct_corner_widened.svg

Wide-Access Corner

Defintion of Wide-Access Corner

contour().addCornerWideacc(radius) is similar to the previous Widended but strokes might be added to provide an access of wide 2 x radius up to the corner. Use this corner-type, if you widen the corner to provide an access to the cutter-tool.

Construction of Wide-Access Corner

construct_corner_wideacc.svg

Corner summary

Corner options jutting corner recess corner
corner pointed no change no change
corner rounded remove material add material
corner widened add material remove material
corner wideAcc add material remove material

Figure

A Figure object consists in several lists:

  1. list of points
  2. list of lines
  3. list of vectors
  4. list of contours called main
  5. list of contours called mainB or main-skeleton
  6. list of contours called second
  7. list of contours called secondB or second-skeleton
  8. list of contours called dynamics

Geom modules

The typescript library Geom dependes only the standard library Math and the standard canvas primitives.

Internally, Geom consists of several modules organised with the following dependencies:

geom_modules.svg