← Back to all sparks
A

affiner

ANALYTICS
Velocity0.0

A Finer Way to Render 3D Illustrated Objects in grid Using Affine Transformations

affiner is quietly turning a grid transformation helper into a small computational geometry library.

r-packagecomputational-geometrygrid-graphicsaffine-transformsr6-classes
Current state
An R package that began as a wrapper around grid's affine transformation primitives, with an angle vector class supporting degrees, radians, half-turns, turns and gradians so users need not convert by hand. Four releases in roughly eighteen months. The recent two have expanded well past that starting point into geometric objects and the predicates that operate on them.
Where it's heading
The direction is clear from the order things arrived. Version 0.2.1 added the predicate layer first — has_intersection(), intersection(), is_equivalent() and is_parallel() as S3 generics working across angle vectors, points, lines and planes. Version 0.3.1 then supplied the objects those generics need, with Ellipse2D, Polygon2D and Segment2D R6 classes plus constructors for rectangles, regular n-gons and isotoxal star polygons, and dot products at one, two and three dimensions. Building the operations before the shapes is unusual ordering but it means each new object type arrives already composable with everything else.
Prediction
Expect more 2D and 3D object types filling out the same generic interface, and the geometry side to keep outgrowing the grid-transformation wrapper the package was named for.

Recent moves

  1. 3mo ago

    Ellipse, polygon and segment objects, with star and n-gon constructors

    Adds Ellipse2D, Polygon2D and Segment2D R6 classes along with constructors for rectangles, regular n-gons and isotoxal star polygons, plus exported dot products in one, two and three dimensions. These are the concrete shapes the generics introduced in 0.2.1 were waiting for, which is why the package's geometry surface expands so quickly here.

    View source ↗
  2. 6mo ago

    Intersection, equivalence and parallelism generics across geometric types

    Introduces has_intersection(), intersection(), is_equivalent() and is_parallel() as S3 generics, with methods spanning angle vectors and the Point1D, Line2D and Plane3D classes — testing congruence for angles and post-standardisation identity for the geometric types. Defining the operations as generics first is what let the next release add object types without reworking anything.

    View source ↗
  3. 1y ago

    Isocube border fill forced transparent

    Ensures isocubeGrob() and grid.isocube() always set the border graphical parameter's fill to transparent. A one-line rendering correction.

    View source ↗
  4. 1y ago

    Initial release: affine grob wrappers and multi-unit angle vectors

    The package's opening scope — affineGrob() and grid.affine() wrapping grid's defineGrob and useGrob, an isocube convenience case, and affine_settings() offered as a standalone file under the Unlicense for other packages to copy. The angle() class supporting five angular units is the piece the later geometry work builds on.

    View source ↗