Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

README.md

points.surface_samples (procNode)

Points scattered by area over a mesh, each carrying every attribute the mesh holds where it landed and N, the unit normal there: the mesh's blended normal, or the face's own where the mesh carries none. points.on_mesh and points.on_surface end here; call it directly to key the draws to a scope of your own, so two scatters over one mesh land apart.

core.sample.surface picks a face by its share of the total area and a place inside it from the draws of the named scope; core.interpolate carries each attribute of the mesh onto the samples; the normal is made a unit vector and the sampler's face and corner columns are dropped. The points carry no id.

Built from: core.sample.surface, core.interpolate, vector.normalize.

Inputs

  • geometry (Geometry). The mesh to scatter over.
  • count (Float, default 256, at least 0). How many points.
  • seed (Float, default 1). Which of the possible layouts this is.
  • graphId (String, default "emit"). The graph the draws are keyed to.
  • nodeId (String, default "sample"). The node the draws are keyed to.

Outputs

  • points (Points). P, N (unit) and every attribute of the mesh.
local rocks = g.points.surface_samples({ geometry = g.mesh.sphere({}), count = 100, graphId = "rocks", nodeId = "scatter" })