Every statement and option · PartScript Help ×

Every statement and option

The whole language in tables. Shorthand forms are in brackets. C is a position (x,y,z, or a named shape's point), S a size, M a material, P a point; [...] is optional. partscript ref prints a one-page version of this.

Top level

statement
prop NAME ["Title"] [subcategory] [option=...]a model. Options below
def NAME [param=default ...]a part with parameters, drawn with use NAME or called as NAME ...
import "PATH" [as NAME]bring in a file or a folder's files, from this file's folder; as keeps their names as NAME.x
set NAME=VALUE ...variables: for its own file when unindented, else for the rest of the block
kit NAME [option=...]a set of building pieces (buildings)
building NAME "Title" kit=KIT [cutaway=open]a building laid out room by room
style NAME [exterior=1]a room style for a host's dressing tools (embedding)
dressing BUCKET piece[:radius] ... / dressing signs KIND=piecepieces for a host's dressing buckets
endcloses a block early (never needed)

prop options

option
hero=1 · budget=Ntriangle budget 6,000 · N (default 2,500)
seed=WORDdeals every draw again (from outside the file: Project.build(name, seed=), partscript build --seed)
px=auto|Ntexel density: sized to the prop, or N texels a metre
ao=auto|Hgrounded shading over the prop's height, or H metres (default 1.4)
for v=a,b,cone prop per value, {v} replaced by it
desc= dd= mount= col= replace=1metadata for a host

Shapes

statementargumentsits own options
box (b)at= size= mat=taper=TX,TY lean=DX,DY skip=+z,-y,... from= to= break= chunk= core= rubble= shade=
bevel_box (bb)at= size= bevel= mat=taper= lean= from= to=
box_between (bx)from=LO to=HI mat=
cylinder (c)at= radius= height= mat=sides= top_radius= axis=x|y|z arc=A0,A1 caps=0 cap_mat= from= to=
coneat= radius= height= mat=sides= axis= from= to=
sphere (sph)at= radius= mat=sides= rings=
tubeat= radius= inner= height= mat=sides= axis=
wedgeat= size= mat=
latheat= mat= then r:z r:z ...sides= cap=1 arc=A0,A1
extrude (ext)at= width= mat= then u:v u:v ...axis=x|y|z taper=
pipemat= radius= then P P ... (or a variable)sides= closed=1 smooth= taper= arc=CX,CZ,R,A0,A1[,N]
sweepmat= prof=x:y,x:y,... then P P ...open=1 closed=1 smooth= taper= arc=
facemat= then P P P ...double=1
panel (pan)at= width= height= mat=double=1
decal (trim)at= width= height= cell=m= (its material)
labelat= width= height= text=sub= bg= fg= wrap= sides= mark= accent= tex= double=1
signat= width= height= text=sub= bg= fg= lit= tex= double=1
torusat= radius= thick= mat=sides= rings= axis=
frameat= width= height= depth= mat=hole=w,h hole_at=x,z
arch_wall (archwall)at= width= height= thick= mat=open= spring= sides=
vaultat= width= depth= rise= mat=sides=
terrainat= size= mat=height= cells= steep= slope= skirt=0

A shape without at= stands at the origin. Pages: shapes, materials and text, generators.

Structure

statement
use NAME [at=] [param=value ...]draw a part, std part, prop or host asset; from= to= lays it between two points; scale=
NAME [at=] [param=value ...]the same as use NAME ...: a part called like a shape
group [at=] [turn=] [scale=] { ... } (at)move, turn or scale lines together
if EXPR { ... }lines kept only while EXPR holds
row x|y|z|-x... [gap=] [over=] [pack=start|centre|end] [align=...] [at=] [on=] { ... }copies end to end (placing)
stack [gap=] ... { ... }a row going up
NAME = LINEname what a line makes
part NAME [smooth=1]start another mesh
size W,D,Hexpected bounds (warns when off by 15%)
card where= pairs= look= avoid= [what=] [notes=]the prop's library card
statement
snap NAME C DIR [up=DIR] [kind=WORD]a connection point (paths)
chain A B*3 C [at=] [turn=]pieces end to end, start snap on end snap
link KIND at=C toward=DIRa loose end
join KIND [reach=.6] [radius=.025] [sides=6] [mat=] [bulge=] [with=DEF]bridge loose ends that nearly meet

Buildings

Inside a building:

statement
room X,Y W,D [storeys=] [storey=] [walls=] [floor=] [roof=none] [theme=] [as=] [fill=DEF ...]a room on the grid
walls KIND [storey=N,M|all] [side=s,n,w,e]outside wall kind for storeys and sides
open X,Y SIDE KIND [storey=]one wall (X or Y may be a range 0..2)
stair X,Y [DIR] [storey=]the kit's stair
roof [PIECE|none] [parapet=PIECE|none]roof and parapet pieces
attach PIECE to=TARGET [at=] [via=] [spin=] [slide=A,B] [as=]snap a piece onto another
place PIECE C [turn=] [as=]a piece at a position

Inside a kit: wall KIND=PIECE ..., piece ROLE=PIECE ... (floor roof parapet partition corner stair), snap PIECE NAME C DIR [up=] [kind=]. Kit options: grid= storey= wall= parapet_lift= stair_cells= stair_exit=ahead|back walls=SET.

Options any line takes

option
turn=RX,RY,RZ (r=)degrees about x, then y, then z
when=EXPRkeep the line, or each copy, only while EXPR holds
on=NAME · on=NAME.sidestand it on a named shape (at= from the middle of its top), or against its front, back, left, right or bottom
fade=Fdarker toward its base (F at the bottom)
wobble=A[,B,C]corners moved up to A, differently each copy
twist=DEG shrink=K bend=DEG[,HEADING]reshape it by height (bending)
smooth=Na curve through the points (pipe, sweep, along)
drop=1|lean sink=Dfall onto what is under it (generators)
jitter=P[,D] (jit=)copies nudged and turned at random
hang=Sa repeat row sags S at its middle
along= every= fit=1 joints=1 corners=1 closed=1copies down a line of points
facing=up|side|down|anywith scatter on: which faces
shade=Ka box's faces K times as bright

Copy phrases

readableshorthand
repeat N [every X,Y,Z]*N@X,Y,ZN in a line
grid AxB[xC] every X,Y[,Z]*AxB@X,Ya grid
ring N [step D]*N%Dturned round the vertical
scatter N over W,D [apart G]*N~W,D,Gover an area
scatter N within R [apart G]*N~R,0,Gover a disc
scatter N on NAME [facing F] [apart G]*N^NAME,Gover a named shape's faces
mirror x|y|z|xy...mx my mzand its mirror image
as k · as col,row[,layer]index=name the copy's number