Skip to content

The Scatter API

Overview

  • scatter
  • scattervec

They contain the same functionality. The only differ in that scattervec takes a single vec (vector) instead of three floats for x,y,z.

API: scatter

arc(count, x, y, z, r, start=0.0, end=90.0, random=False)

Calculate the points along an circular arc

Parameters:

Name Type Description Default
count int

The number of points to generate

required
x,y,z (float, float, float)

the center point/origin

required
r float

radius

required
start float

the angle to start at in degrees. Default 0

0.0
end float

the angle to end at in degrees default 360

90.0

Returns:

Name Type Description
points generator

A generator of Vec3

box(count, x, y, z, x2, y2, z2, centered=False, ax=0, ay=0, az=0, degrees=True)

Calculate the points within a box

Args: count (int): The number of points to generate

x,y,z (float,float,float): the start point/origin if center is true this is the center if center is False this is the left, bottom, front x2y2,z2 (float,float,float): if center is true this is the width, height, depth if center is false this is the right, top, back

center (bool): when true x,y,z and its the center point when true x2,y2,z2 is the width, height, depth when false x,y,z is left, bottom, front when false x2,y2,z2 is right, top, back

Returns:

Name Type Description
points generator

A generator of Vec3

box_fill(cw, ch, cd, x, y, z, w, h, d, random=False, ax=0, ay=0, az=0, degrees=True)

Calculate the points within a box the box is subdivide to ideally avoid overlap

Parameters:

Name Type Description Default
cw int

The number of points to generate for each line width (x)

required
ch int

The number of points to generate for each line height (y)

required
cd int

The number of points to generate for each line width (z)

required
x,y,z (float, float, float)

the start point/origin

required
w float

the width

required
h float

the height

required
d float

the depth

required
random bool

when true pointw will be randomly placed when false points will be evenly placed

False

Returns:

Name Type Description
points generator

A generator of Vec3

line(count, start_x, start_y, start_z, end_x, end_y, end_z, random=False)

Calculate the points along a line

Parameters:

Name Type Description Default
count int

The number of points to generate

required
start_x float

the start point/origin

required
start_y float

the start point/origin

required
start_z float

the start point/origin

required
end_x float

the end point/origin

required
end_y float

the end point/origin

required
end_z float

the end point/origin

required

Returns:

Name Type Description
points generator

A generator of Vec3

rect_fill(cw, cd, x, y, z, w, d, random=False, ax=0, ay=0, az=0, degrees=True)

Calculate the points within a rect

This assumes it to be on y

Parameters:

Name Type Description Default
cw int

The number of points to generate for each line width (x)

required
cd int

The number of points to generate for each line depth (z)

required
xy,z (float, float, float)

the start point/origin

required
w float

the width (x)

required
d float

the depth (z)

required
random bool

when true pointw will be randomly placed when false points will be evenly placed

False

Returns:

Name Type Description
points generator

A generator of Vec3

ring(ca, cr, x, y, z, outer_r, inner_r=0, start=0.0, end=90.0, random=False)

Calculate the points on rings with each ring has same count

Parameters:

Name Type Description Default
ca int

The number of points to generate on each ring

required
cr int

The number of rings

required
x,y,z (float, float, float)

the start point/origin

required
outer_r float

the radius

required
inner_r float

the radius inner

0
start float

degrees start angle

0.0
end float

degrees start angle

90.0
random bool

when true pointw will be randomly placed. when false points will be evenly placed

False

Returns:

Name Type Description
points generator

A generator of Vec3

ring_density(counts, x, y, z, outer_r, inner_r=0, start=0.0, end=90.0, random=False)

Calculate the points on rings with each ring specifying count in array

Parameters:

Name Type Description Default
count int

The number of points to generate

required
x,y,z (float, float, float)

the start point/origin

required
outer_r float

the radius

required
inner_r float = 0 optional

the radius inner

0
start float (degrees

start angle

0.0
end float (degrees

start angle

90.0
random bool

when true pointw will be randomly placed. when false points will be evenly placed

False

Returns:

Name Type Description
points generator

A generator of Vec3

sphere(count, x, y, z, r, outer=0, top_only=False, ring=False)

Calculate the points within a sphere or ring

Parameters:

Name Type Description Default
count int

The number of points to generate

required
x,y,z (float, float, float)

the start point/origin

required
r float

the radius if outer is spedified this is the inner

required
outer float = 0 optional

the height

0
top_only bool

generate only top hemispher

False
ring bool

generate a flat ring

False

Returns:

Name Type Description
points generator

A generator of Vec3

API: scattervec

arc(count, v, r, start=0.0, end=90.0, random=False)

Calculate the points along an circular arc

Parameters:

Name Type Description Default
count int

The number of points to generate

required
v Vec3

the center point/origin

required
r float

radius

required
start float

the angle to start at in degrees. Default 0

0.0
end float

the angle to end at in degrees default 360

90.0

Returns:

Name Type Description
points generator

A generator of Vec3

box(count, v1, v2, centered=False, a=None, degrees=True)

Calculate the points within a box

Args: count (int): The number of points to generate

v1 (Vec2): the start point/origin if center is true this is the center if center is False this is the left, bottom, front v2 (Vec3): if center is true this is the width, height, depth if center is false this is the right, top, back

center (bool): when true x,y,z and its the center point when true x2,y2,z2 is the width, height, depth when false x,y,z is left, bottom, front when false x2,y2,z2 is right, top, back

Returns:

Name Type Description
points generator

A generator of Vec3

box_fill(cw, ch, cd, v, w, h, d, random=False)

Calculate the points within a box the box is subdivide to ideally avoid overlap

Parameters:

Name Type Description Default
cw int

The number of points to generate for each line width (x)

required
ch int

The number of points to generate for each line height (y)

required
cd int

The number of points to generate for each line width (z)

required
v Vec3

the start point/origin

required
w float

the width

required
h float

the height

required
d float

the depth

required
random bool

when true pointw will be randomly placed when false points will be evenly placed

False

Returns:

Name Type Description
points generator

A generator of Vec3

line(count, start, end, random=False)

Calculate the points along a line

Parameters:

Name Type Description Default
count int

The number of points to generate

required
start Vec3

the start point/origin

required
end Vec3

the end point/origin

required

Returns:

Name Type Description
points generator

A generator of Vec3

rect_fill(cw, cd, v, w, d, random=False)

Calculate the points within a rect

This assumes it to be on y

Parameters:

Name Type Description Default
cw int

The number of points to generate for each line width (x)

required
cd int

The number of points to generate for each line depth (z)

required
v Vec3

the start point/origin

required
w float

the width (x)

required
d float

the depth (z)

required
random bool

when true pointw will be randomly placed when false points will be evenly placed

False

Returns:

Name Type Description
points generator

A generator of Vec3

ring(ca, cr, v, outer_r, inner_r=0, start=0.0, end=90.0, random=False)

Calculate the points on rings with each ring has same count

Parameters:

Name Type Description Default
ca int

The number of points to generate on each ring

required
cr int

The number of rings

required
v Vec3

the start point/origin

required
outer_r float

the radius

required
inner_r float

the radius inner

0
start float

degrees start angle

0.0
end float

degrees start angle

90.0
random bool

when true pointw will be randomly placed. when false points will be evenly placed

False

Returns:

Name Type Description
points generator

A generator of Vec3

ring_density(counts, v, outer_r, inner_r=0, start=0.0, end=90.0, random=False)

Calculate the points on rings with each ring specifying count in array

Parameters:

Name Type Description Default
count int

The number of points to generate

required
v Vec3

the start point/origin

required
outer_r float

the radius

required
inner_r float

the radius inner

0
start float

(degrees) start angle

0.0
end float

(degrees) start angle

90.0
random bool

when true pointw will be randomly placed. when false points will be evenly placed

False

Returns:

Name Type Description
points generator

A generator of Vec3

sphere(count, v, r, outer=0, top_only=False, ring=False)

Calculate the points within a sphere or ring

Parameters:

Name Type Description Default
count int

The number of points to generate

required
v Vec3

the start point/origin

required
r float

the radius if outer is spedified this is the inner

required
outer float = 0 optional

the height

0
top_only bool

generate only top hemispher

False
ring bool

generate a flat ring

False

Returns:

Name Type Description
points generator

A generator of Vec3