Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

README.md

points.on_surface (procNode)

Scatter points uniformly over a geometry's surface, area-weighted and deterministic. Each point carries the surface direction under it as a normal attribute: interpolated from the geometry's normals where it has them, the flat facet normal where it does not.

points.surface_samples on the points scope, reduced to P and the unit normal under each point as normal. points.on_mesh keeps every attribute of the mesh and names the normal N.

Built from: points.surface_samples, core.points.

Inputs

  • geometry (Geometry). The surface to scatter over. Faces are picked in proportion to their area.
  • count (Float, default 100, at least 0). How many points to scatter over the whole surface: a total for the mesh, divided among its faces by area.
  • seed (Float, default 1). Picks where on the surface the points land: one seed scatters identically on every run, machine and platform.

Outputs

  • points (Points). P, normal (unit) and id.
local studs = g.points.on_surface({ geometry = g.mesh.box({}), count = 50 })