Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit65083fe8f2

README.md

points (nodebox)

Point clouds: the nodes that make points, read what stands around them, thin them, move them and compose their pose. Points are a Geometry with points and no primitives; the instancing, prefab and particle nodes stand something on each one.

  • Shapes: points.grid (a flat lattice on XZ), points.box (a 3D lattice), points.disc, points.sphere, points.cylinder, points.cone (random points in or on a shape, each drawn on its own so count adds points without moving the others) and points.poisson (blue noise in a disc, no two closer than minDist).
  • From geometry: points.from_vertices (a point per point of a mesh), points.on_mesh and points.on_surface (scattered by area over a mesh), points.surface_samples (the scatter they share, keyed to a scope of your own), points.on_curve (evenly along curves by arc length) and points.from_grid (a grid's cell centres).
  • Around each point: points.neighbors (count, nearest distance, centroid, a neighbour mean) and points.count_neighbors (occupied lattice neighbours of voxel-like points).
  • Change: points.filter (keep the points a mask or an attribute passes), points.relax (even out spacing) and points.pose (compose pscale, rot, trans, pivot, N, v and up into P, orient and scale).
  • Parts: points.axis_basis and points.shell_radius, which the shapes are built from.

Every node that makes points numbers them as id (0 upward), except points.poisson and points.surface_samples. A seed draws the same points on every run, machine and platform.

local spots = g.points.poisson({ radius = 4, minDist = 0.8 })
local kept = g.points.filter({ points = spots, mask = spots.point.P.x })