3DCoatScripting  4.8.31β
You can manage 3DСoat features with help of scripting
🌀 Create the user interfaces for primitives

Primitives in the 3DCoat can be created by using the primitive classes, control the parameters of primitives, add and delete the primitives from scene.

Lets start with a primitives tool.

Primitives tool

Copy this script to your local drive and run it from 3DCoat: "Script / Run Script". Don't know how to do that, check here.

// access to debugging
Debug dbg;
DebugLog log = dbg.log();
void main() {
Coat coat;
log.clear();
// go to sculpt room
coat.room("Sculpt");
// go to primitives
UI ui;
ui("$SCULP_PRIM");
// voxel object
Vox vox1;
vox1.clearScene();
vox1.rename("Volume0");
//prepare the primitives tool
PrimitivesTool tool;
//create sphere obj
SpherePrim sphere = tool.sphere();
//create cube obj
CubPrim cube = tool.cube();
//create cylinder obj
CylinderPrim cylinder = tool.cylinder();
//create cone obj
ConePrim cone = tool.cone();
//create torus obj
TorusPrim torus = tool.torus();
float timeDelay = 2000; //delay 2 sec
//goto to sphere
tool.SetPrim("sphere");
sphere.Radius(50.0);
sphere.Position(Vec3(-400,-50,0));
// add sphere in the scene
tool.Apply(0);
//goto cylinder
tool.SetPrim("cylinder");
cylinder.radius(50.0);
cylinder.startPoint(Vec3(-300,0,0));
cylinder.endPoint(Vec3(-300,100,0));
// add cylinder in the scene
tool.Apply(0);
// goto cube
tool.SetPrim("cube");
Wait(timeDelay);
// goto cone
tool.SetPrim("cone");
// sets parameters
cone.startPoint(Vec3(-500,0,0));
cone.endPoint(Vec3(-500,100,0));
cone.radius(50);
// add cone in the scene
tool.Apply(0);
}

primitives-tool.png
Primitives Tool

The result of code script see here

PrimitivesTool tool;

With help of `Primitives Tool` we'll make various primitives.

How to create a primitives in the Sculpt Room

We can use for creating primitives the following classes:

Sphere

Copy this script to your local drive and run it from 3DCoat: "Script / Run Script". Don't know how to do that, check here.

void main() {
Coat coat;
// go to sculpt room
coat.room("Sculpt");
// voxel object
Vox vox1;
//clear the scene
vox1.clearScene();
vox1.rename("Volume4");
// go to primitives
UI ui;
ui("$SCULP_PRIM");
// prepare the primitives tool
PrimitivesTool tool;
// sphere object
SpherePrim sphere1;
//gets the sphere tool
sphere1 = tool.sphere();
// initializing parameters
sphere1.Position(Vec3(0.00,0.00,0.00));
sphere1.Radius(15.00);
// go tо the surface mode
vox1.toSurface();
//Change the radius and position
sphere1.Position(Vec3(-300.00,-12.00,369.07));
sphere1.Radius(74.72);
// add the sphere in the scene
// Zero equals the binary operation "add"
tool.Apply(0);
}
SpherePrim sphere = tool.sphere()
//Tell tool-script that we'd like to create sphere.

All parameters related to Sphere check here.

sphere-prim.png
Sphere Primitive

The result of code script see here

Cube

Copy this script to your local drive and run it from 3DCoat: "Script / Run Script". Don't know how to do that, check here.

void main() {
Coat coat;
// go to sculpt room
coat.room("Sculpt");
// voxel object
Vox vox1;
//clear the sculpt room
vox1.clearScene();
vox1.rename("Volume3");
// go to primitives
UI ui;
ui("$SCULP_PRIM");
//prepare the primitives tool
PrimitivesTool tool;
// gets Cube prim
CubPrim cube2;
cube2 = tool.cube();
//initializing cube
cube2.AxisX(Vec3(1.00,0.00,0.00));
cube2.AxisY(Vec3(0.00,1.00,0.00));
cube2.AxisZ(Vec3(0.00,0.00,1.00));
// no fillet mode
cube2.useFillet(false);
cube2.Position(Vec3(0.00,0.00,0.00));
cube2.SideA(30.00);
cube2.SideB(30.00);
cube2.SideC(30.00);
// go tо the surface mode
vox1.toSurface();
// sets fillet mode
cube2.useFillet(true);
// sets radius
cube2.filletRadiusRelation(0.20);
cube2.filletRadius(14.41);
// sets position
cube2.Position(Vec3(-223.11,44.94,336.39));
// sets sides
cube2.SideA(144.11);
cube2.SideB(144.11);
cube2.SideC(144.11);
cube2.details(0.38);
// add the cube in the scene
tool.Apply(0);
}

All parameters related to Cube check here.

cube-prim.png
Cube Primitive

The result of code script see here

Ellipse

Copy this script to your local drive and run it from 3DCoat: "Script / Run Script". Don't know how to do that, check here.

void main() {
Coat coat;
UI ui;
// go to sculpt room
coat.room("Sculpt");
// clear the sculpt room
SculptRoom sculpt;
sculpt.clear();
sculpt.toVoxel();
// get vox object
Vox vox1;
vox1.clearScene();
vox1.rename("Volume12");
//prepare the primitives tool
PrimitivesTool tool;
// gp to primitives
ui("$SCULP_PRIM");
//gets ellipse tool
EllipsePrim ellipse3;
ellipse3 = tool.ellipse();
// init parameters
ellipse3.Position(Vec3(-307.18,61.64,380.09));
ellipse3.SideA(40.82);
ellipse3.SideB(40.89);
ellipse3.SideC(108.31);
ellipse3.AxisX(Vec3(1.00,-0.04,-0.01));
ellipse3.AxisY(Vec3(0.04,0.99,0.15));
ellipse3.AxisZ(Vec3(0.00,-0.15,0.99));
// go to surface mode
vox1.toSurface();
// set new sides
ellipse3.SideA(51.39);
ellipse3.SideB(51.48);
ellipse3.SideC(136.36);
// sets detail level
ellipse3.details(0.61);
//add in the scene
tool.Apply(0);
}

ellipse-prim.png
Ellipse Primitive

The result of code script see here

Cylinder

Copy this script to your local drive and run it from 3DCoat: "Script / Run Script". Don't know how to do that, check here.

void main() {
Coat coat;
UI ui;
coat.room("Sculpt");
//prepare the scene
SculptRoom sculpt;
sculpt.clear();
sculpt.toVoxel();
//prepare the vox
Vox vox1;
vox1.clearScene();
vox1.rename("Volume3");
vox1.toSurface();
//prepare the primitives tool
PrimitivesTool tool;
ui("$SCULP_PRIM");
// gets cylinder
CylinderPrim cylinder4;
cylinder4 = tool.cylinder();
cylinder4.useFillet(true);
cylinder4.filletRadiusRelation(0.20);
cylinder4.startPoint(Vec3(-280.98,23.17,236.68));
cylinder4.endPoint(Vec3(-292.61,159.80,242.19));
cylinder4.height(137.24);
cylinder4.radius(52.42);
cylinder4.topRadius(52.42);
cylinder4.bottomRadius(52.42);
cylinder4.scalex(1.00);
cylinder4.scaley(1.00);
cylinder4.details(0.69);
// add in the scene
tool.Apply(0);
cylinder4.startPoint(Vec3(-251.18,102.24,277.48));
cylinder4.endPoint(Vec3(-221.85,103.49,308.54));
cylinder4.height(42.73);
cylinder4.radius(27.30);
cylinder4.topRadius(27.30);
cylinder4.bottomRadius(27.30);
// add in the scene
tool.Apply(0);
cylinder4.startPoint(Vec3(-335.49,85.39,257.88));
cylinder4.endPoint(Vec3(-394.83,79.38,281.57));
cylinder4.height(64.17);
// add in the scene
tool.Apply(0);
cylinder4.startPoint(Vec3(-295.43,127.83,244.86));
cylinder4.endPoint(Vec3(-306.96,263.31,250.33));
cylinder4.height(136.08);
// add in the scene
tool.Apply(0);
}

cylinder-prim.png
Cylinder Primitive

The result of code script see here

Cone

Copy this script to your local drive and run it from 3DCoat: "Script / Run Script". Don't know how to do that, check here.

void main() {
Coat coat;
UI ui;
//go to sculpt room
coat.room("Sculpt");
//prepare the scene
SculptRoom sculpt;
sculpt.toVoxel();
//clear the sculpt room
Vox vox1;
vox1.clearScene();
vox1.rename("Volume1");
//prepare the primitives tool
PrimitivesTool tool;
// go to primitives
ui("$SCULP_PRIM");
// create cone obj
ConePrim cone5;
cone5 = tool.cone();
// init parameters
cone5.startPoint(Vec3(0.00,0.00,0.00));
cone5.endPoint(Vec3(0.00,20.00,0.00));
cone5.height(20.00);
cone5.bottomRadius(10.00);
// change parameters
cone5.useFillet(true);
cone5.filletRadiusRelation(0.20);
cone5.startPoint(Vec3(-285.69,-58.62,257.72));
cone5.endPoint(Vec3(-305.78,108.83,232.01));
cone5.height(170.60);
cone5.bottomRadius(74.79);
// add in the scene
tool.Apply(0);
}

cone-prim.png
Cone Primitive

The result of code script see here

Capsule

Copy this script to your local drive and run it from 3DCoat: "Script / Run Script". Don't know how to do that, check here.

void main() {
Coat coat;
UI ui;
//go to sculpt room
coat.room("Sculpt");
//prepare the scene
SculptRoom sculpt;
sculpt.toVoxel();
//clear the sculpt room
Vox vox1;
vox1.clearScene();
vox1.rename("Volume58");
//prepare the primitives tool
PrimitivesTool tool;
// go to primitives
ui("$SCULP_PRIM");
// create the capsule obj
CapsulePrim capsule16;
capsule16 = tool.capsule();
// init parameters
capsule16.useDiameter(false);
//positions
capsule16.startPoint(Vec3(-502.04,-138.54,138.58));
capsule16.endPoint(Vec3(-502.04,31.45,138.58));
capsule16.height(169.98);
capsule16.radius(41.13);
capsule16.topRadius(41.13);
capsule16.bottomRadius(41.13);
// scales
capsule16.scalex(1.00);
capsule16.Cap1(1.00);
capsule16.scaley(1.00);
capsule16.Cap2(1.00);
capsule16.scalex(1.00);
capsule16.Cap1(1.00);
capsule16.scaley(1.00);
capsule16.Cap2(1.00);
// goto surface mode
vox1.to("Volume58");
vox1.toSurface();
// change parameters
capsule16.startPoint(Vec3(-457.88,-216.68,227.52));
capsule16.endPoint(Vec3(-583.86,-116.64,64.04));
capsule16.height(229.36);
capsule16.radius(55.49);
capsule16.topRadius(55.49);
capsule16.bottomRadius(55.49);
capsule16.details(0.84);
// add in the scene
tool.Apply(0);
}

capsule-prim.png
Capsule Primitive

The result of code script see here

Tube

Copy this script to your local drive and run it from 3DCoat: "Script / Run Script". Don't know how to do that, check here.

void main() {
Coat coat;
UI ui;
//go to sculpt room
coat.room("Sculpt");
//prepare the scene
SculptRoom sculpt;
sculpt.toVoxel();
//clear the sculpt room
Vox vox1;
vox1.clearScene();
vox1.rename("Volume1");
//prepare the primitives tool
PrimitivesTool tool;
// go to primitives
ui("$SCULP_PRIM");
// goto surface mode
vox1.toSurface();
// create the tube obj
TubePrim tube7;
tube7 = tool.tube();
// init parameters
tube7.startPoint(Vec3(-223.68,3.57,222.30));
tube7.endPoint(Vec3(-230.67,118.01,173.44));
tube7.height(124.63);
tube7.radius(32.72);
tube7.WallThickness(16.36);
tube7.details(0.84);
// change parameters
tube7.useFillet(true);
tube7.Bevel(1,false);
tube7.Bevel(2,true);
tube7.filletRadiusRelation(0.20);
tube7.startPoint(Vec3(-227.87,-73.63,238.01));
tube7.endPoint(Vec3(-217.73,113.49,199.92));
tube7.height(191.24);
tube7.radius(50.20);
tube7.WallThickness(25.10);
tube7.details(0.57);
// add in the scene
tool.Apply(0);
}

tube-prim.png
Tube Primitive

The result of code script see here

NGon

Copy this script to your local drive and run it from 3DCoat: "Script / Run Script". Don't know how to do that, check here.

void main() {
Coat coat;
UI ui;
//go to sculpt room
coat.room("Sculpt");
//prepare the scene
SculptRoom sculpt;
sculpt.toVoxel();
//clear the sculpt room
Vox vox1;
vox1.clearScene();
vox1.rename("Volume1");
//prepare the primitives tool
PrimitivesTool tool;
// go to primitives
ui("$SCULP_PRIM");
// create the ngon obj
NGonPrim ngon8;
ngon8 = tool.ngon();
// sets position
ngon8.startPoint(Vec3(238.79,-48.69,340.52));
ngon8.endPoint(Vec3(238.79,118.53,340.52));
// height & radius
ngon8.height(167.22);
ngon8.radius(68.07);
// account of sides
ngon8.Order(6);
// add in the scene
tool.Apply(0);
}

ngon-prim.png
NGon Primitive

The result of code script see here

Gear

Copy this script to your local drive and run it from 3DCoat: "Script / Run Script". Don't know how to do that, check here.

void main() {
Coat coat;
UI ui;
//go to sculpt room
coat.room("Sculpt");
//prepare the scene
SculptRoom sculpt;
sculpt.toVoxel();
//clear the sculpt room
Vox vox1;
vox1.clearScene();
vox1.rename("Volume1");
//prepare the primitives tool
PrimitivesTool tool;
// go to primitives
ui("$SCULP_PRIM");
// create the gear obj
GearPrim gear9;
gear9 = tool.gear();
// position
gear9.startPoint(Vec3(0.00,0.00,0.00));
gear9.endPoint(Vec3(0.00,20.00,0.00));
// init parameters
gear9.height(20.00);
gear9.radius(10.00);
gear9.Depth(0.10);
gear9.Sharpness(0.5);
gear9.Order(16);
// change parameters
gear9.startPoint(Vec3(285.31,-181.30,495.22));
gear9.endPoint(Vec3(285.31,-33.71,478.45));
gear9.height(148.55);
gear9.radius(94.87);
// add in the scene
tool.Apply(0);
}

gear-prim.png
Gear Primitive

The result of code script see here

Lathe

Copy this script to your local drive and run it from 3DCoat: "Script / Run Script". Don't know how to do that, check here.

void main() {
Coat coat;
// go to sculpt room
coat.room("Sculpt");
// voxel object
Vox vox1;
//clear the sculpt room
vox1.clearScene();
vox1.rename("Volume2");
// go to primitives
UI ui;
ui("$SCULP_PRIM");
//prepare the primitives tool
PrimitivesTool tool;
// create the lathe object
LathePrim lathe10;
lathe10 = tool.lathe();
// sets axises
lathe10.AxisX(Vec3(0.22,0.08,0.97));
lathe10.AxisY(Vec3(-0.09,0.99,-0.06));
lathe10.AxisZ(Vec3(-0.97,-0.07,0.23));
// sets position
lathe10.Position(Vec3(-141.10,35.58,306.22));
// sets sides
lathe10.SideA(160.96);
lathe10.SideB(160.96);
lathe10.SideC(160.96);
// Cylinder
lathe10.LatheType(0);
//points coordinates
lathe10.SetPoint(0,0.00,0.50,0);
lathe10.SetPoint(1,0.49,0.11,0);
lathe10.SetPoint(2,1.00,0.50,0);
// add lathe in the scene
tool.Apply(0);
}

lathe-prim.png
Lathe Primitive

The result of code script see here

Text

Copy this script to your local drive and run it from 3DCoat: "Script / Run Script". Don't know how to do that, check here.

void main() {
Coat coat;
// go to sculpt room
coat.room("Sculpt");
// voxel object
Vox vox1;
//clear the sculpt room
vox1.clearScene();
vox1.rename("Volume2");
// go to primitives
UI ui;
ui("$SCULP_PRIM");
//create the font object
Font font;
//font parameters
font.Name("Arial");
font.Size(96);
font.Weight(400);
font.Style(0);
font.OutPrecision(3);
font.ClipPrecision(2);
font.CharSet(0);
font.Quality(4);
font.Family(34);
//prepare the primitives tool
PrimitivesTool tool;
//create the text object
TextPrim text11;
text11 = tool.text();
//sets text
text11.SetText("Sculpt room");
//axis transform
text11.AxisX(Vec3(0.77,0.00,-0.64));
text11.AxisY(Vec3(-0.34,0.85,-0.41));
text11.AxisZ(Vec3(0.54,0.53,0.65));
//position
text11.Position(Vec3(-293.23,132.34,210.24));
//sides
text11.SideA(174.53);
text11.SideB(174.53);
text11.SideC(17.45);
//rotation
text11.ExtraRotation(-21.60);
//bending
text11.Bend(false);
//add text object in the scene
tool.Apply(0);
}

text-prim.png
Text Primitive

The result of code script see here

Image

Copy this script to your local drive and run it from 3DCoat: "Script / Run Script". Don't know how to do that, check here.

void main() {
Coat coat;
// go to sculpt room
coat.room("Sculpt");
// voxel object
Vox vox1;
//clear the sculpt room
vox1.clearScene();
vox1.rename("Volume3");
// go to primitives
UI ui;
ui("$SCULP_PRIM");
//prepare the primitives tool
PrimitivesTool tool;
//create the image object
ImagePrim image12;
image12 = tool.image();
image12.AxisX(Vec3(0.80,0.00,-0.60));
image12.AxisY(Vec3(0.00,1.00,0.00));
image12.AxisZ(Vec3(0.60,0.00,0.80));
// Pos & sides
image12.Position(Vec3(-257.19,0.00,282.29));
image12.SideA(128.02);
image12.SideB(128.02);
image12.SideC(12.80);
// rotation
image12.ExtraRotation(0.00);
// bending
image12.Bend(false);
ImageMeshParam imparam1;
// sets the size in the scene
imparam1.SizeInScene(100.00);
// sets the pictures
imparam1.Top("/images/Bracelet.png");
imparam1.TopBump("/images/Bracelet.png");
// picture weight
imparam1.TopBottomWeight(0.70);
imparam1.BasicThickness(8.00);
imparam1.BumpThickness(8.00);
// pick the image
image12.PickImage();
// resize object
image12.SideA(91.12);
image12.SideB(91.12);
image12.SideC(9.11);
// add the image in the scene
tool.Apply(0);
}

image-prim.png
Image Primitive

The result of code script see here

Spiral

Copy this script to your local drive and run it from 3DCoat: "Script / Run Script". Don't know how to do that, check here.

void main() {
Coat coat;
UI ui;
// go to sculpt room
coat.room("Sculpt");
SculptRoom sculpt;
sculpt.toVoxel();
//gets vox obj
Vox vox1;
vox1.clearScene();
vox1.rename("Volume4");
PrimitivesTool tool;
// go to primitives
ui("$SCULP_PRIM");
// create the spiral
SpringPrim spring13;
spring13 = tool.spring();
// sets a position
spring13.Position(Vec3(-318.50,0.00,316.36));
spring13.Position2(Vec3(-318.50,2.00,316.40));
// scale
spring13.ScaleRadius(1.00);
spring13.OuterDiameter(67.96);
// sets the pitch
spring13.Pitch(33.98);
spring13.ProfileDiameter(16.99);
spring13.ProfileRadiusRelation(0.50);
// account turns
spring13.Turns(7);
// spiral direction
spring13.ClockWise(true);
// add the spiral in the scene
tool.Apply(0);
}

spiral-prim.png
Spiral Primitive

The result of code script see here

Torus

Copy this script to your local drive and run it from 3DCoat: "Script / Run Script". Don't know how to do that, check here.

void main() {
Coat coat;
UI ui;
// go to sculpt room
coat.room("Sculpt");
SculptRoom sculpt;
sculpt.toVoxel();
//gets vox obj
Vox vox1;
vox1.clearScene();
vox1.rename("Volume5");
PrimitivesTool tool;
// go to primitives
ui("$SCULP_PRIM");
// create the torus
TorusPrim torus14;
torus14 = tool.torus();
// init parameters
torus14.Position(Vec3(0.00,0.00,0.00));
torus14.SideA(30.00);
torus14.SideB(30.00);
torus14.SideC(30.00);
torus14.RadiusRelation(0.50);
torus14.OuterRadius(30.00);
torus14.InnerRadius(15.00);
torus14.ProfileRadius(7.50);
torus14.AxisX(Vec3(1.00,0.05,-0.04));
torus14.AxisY(Vec3(-0.05,1.00,0.05));
torus14.AxisZ(Vec3(0.04,-0.05,1.00));
// go to surface mode
vox1.toSurface();
// change parameters
torus14.Position(Vec3(-525.58,-37.10,196.04));
// sides
torus14.SideA(102.64);
torus14.SideB(102.64);
torus14.SideC(102.64);
// radius
torus14.OuterRadius(102.64);
torus14.InnerRadius(51.32);
torus14.ProfileRadius(25.66);
torus14.AxisX(Vec3(0.83,0.02,-0.56));
torus14.AxisY(Vec3(-0.01,1.00,0.02));
torus14.AxisZ(Vec3(0.56,-0.01,0.83));
// details level
torus14.details(0.81);
// add the torus in the scene
tool.Apply(0);
}

torus-prim.png
Torus Primitive

The result of code script see here

Screw-Thread

Copy this script to your local drive and run it from 3DCoat: "Script / Run Script". Don't know how to do that, check here.

void main() {
Coat coat;
UI ui;
//go to sculpt room
coat.room("Sculpt");
Vox vox1;
//clear the scene
vox1.clearScene();
vox1.rename("Volume3");
// go to surface mode
vox1.toSurface();
//prepare the primitives tool
PrimitivesTool tool;
// go to primitives
ui("$SCULP_PRIM");
// create thread object
ThreadPrim thread15;
thread15 = tool.thread();
// position
thread15.Position(Vec3(-416.06,-69.18,174.47));
//diameter
thread15.Diameter(135.42);
thread15.Pitch(22.57);
thread15.Turns(10);
// triangle profile
thread15.Profile(ProfileType::TRIANGLE);
thread15.ClockWise(true);
thread15.StubHeight(4.51);
// go to surface mode
vox1.toSurface();
// set detail level
thread15.details(0.59);
// add in the scene
tool.Apply(0);
}

screwthread-prim.png
Screw-Thread Primitive

The result of code script see here

Screw Thread With Core

Copy this script to your local drive and run it from 3DCoat: "Script / Run Script". Don't know how to do that, check here.

void main() {
Coat coat;
UI ui;
// go to sculpt room
coat.room("Sculpt");
Vox vox1;
// clear the scene
vox1.clearScene();
vox1.rename("Volume36");
// go to surface mode
vox1.toSurface();
// prepare the primitives tool
PrimitivesTool tool;
// go to primitives
ui("$SCULP_PRIM");
// create core thread object
CoreThreadPrim coreThread16;
coreThread16 = tool.corethread();
// position
coreThread16.Position(Vec3(-423.00,-51.63,202.36));
// length
coreThread16.Length(252.50);
// core diameter
coreThread16.Diameter(126.25);
// thread length
coreThread16.ThreadLength(168.33);
// pitch
coreThread16.Pitch(21.04);
// round type
coreThread16.Profile(ProfileType::ROUND);
// add in the scene
tool.Apply(0);
}

screwcorethread-prim.png
Screw-Thread With Core Primitive

The result of code script see here

Bolt's head

Copy this script to your local drive and run it from 3DCoat: "Script / Run Script". Don't know how to do that, check here.

void main() {
Coat coat;
UI ui;
//go to sculpt room
coat.room("Sculpt");
Vox vox1;
//clear the scene
vox1.clearScene();
vox1.rename("Volume36");
vox1.toSurface();
//prepare the primitives tool
PrimitivesTool tool;
// go to primitives
ui("$SCULP_PRIM");
// create bolt head object
BoltHeadPrim bolthead17;
bolthead17 = tool.bolthead();
// init position
bolthead17.Position(Vec3(-366.07,0.00,196.40));
// hexa type
bolthead17.HeadType(SHeadType::HEXA);
// disable slit
bolthead17.UseSlit(false);
bolthead17.Diameter(165.80);
bolthead17.Height(55.27);
//enable slit
bolthead17.UseSlit(true);
// slit dimensions
bolthead17.SlitWidth(8.07);
bolthead17.SlitLength(120.39);
bolthead17.SlitHeight(5.00);
// slot
bolthead17.SlitType(SSlitType::SLOT);
//add in the scene
tool.Apply(0);
}

bolthead-prim.png
Bolt's head Primitive

The result of code script see here

Bolt

Copy this script to your local drive and run it from 3DCoat: "Script / Run Script". Don't know how to do that, check here.

void main() {
Coat coat;
UI ui;
//go to sculpt room
coat.room("Sculpt");
Vox vox1;
//clear the scene
vox1.clearScene();
vox1.rename("Volume36");
vox1.toSurface();
//prepare the primitives tool
PrimitivesTool tool;
// go to primitives
ui("$SCULP_PRIM");
// create bolt object
BoltPrim bolt18;
bolt18 = tool.bolt();
// sets to custom mode
bolt18.Custom();
// position
bolt18.Position(Vec3(-336.02,-80.03,161.63));
// hexa bolt head
bolt18.HeadType(SHeadType::HEXA);
// triangle profile
bolt18.Profile(ProfileType::TRIANGLE);
// go to surface mode
vox1.toSurface();
// change axis parameters
bolt18.AxisX(Vec3(-0.01,-0.22,-0.97));
bolt18.AxisY(Vec3(0.93,0.36,-0.09));
bolt18.AxisZ(Vec3(0.37,-0.91,0.20));
bolt18.Diameter(281.71);
bolt18.Height(93.90);
bolt18.BodyLength(281.71);
bolt18.BodyDiameter(140.85);
bolt18.ThreadLength(187.81);
bolt18.Pitch(23.48);
// detail level
bolt18.details(0.32);
// add in the scene
tool.Apply(0);
}

bolt-prim.png
Bolt Primitive

The result of code script see here

Screw

Copy this script to your local drive and run it from 3DCoat: "Script / Run Script". Don't know how to do that, check here.

void main() {
Coat coat;
UI ui;
//go to sculpt room
coat.room("Sculpt");
Vox vox1;
//clear the scene
vox1.clearScene();
vox1.rename("Volume36");
vox1.toSurface();
//prepare the primitives tool
PrimitivesTool tool;
// go to primitives
ui("$SCULP_PRIM");
// create screw object
TapScrewPrim screw19;
screw19 = tool.tapscrew();
// sets custom mode
screw19.Custom();
// go to surface mode
vox1.toSurface();
// axises
screw19.AxisX(Vec3(0.03,0.03,-1.00));
screw19.AxisY(Vec3(0.98,0.18,0.03));
screw19.AxisZ(Vec3(0.18,-0.98,-0.03));
// init position
screw19.Position(Vec3(-239.87,-45.06,255.75));
//other parameters
screw19.HeadDiameter(210.99);
screw19.HeadHeight(70.33);
screw19.HeadType(SHeadType::BUGLE);
//enable slit
screw19.UseSlit(true);
screw19.SlitWidth(10.55);
screw19.SlitLength(216.26);
screw19.SlitHeight(17.58);
screw19.SlitType(SSlitType::SLOT);
screw19.Length(281.31);
screw19.Diameter(70.33);
screw19.UseThread(true);
screw19.UseGroove(false);
screw19.ThreadLength(210.99);
screw19.ThreadDiameter(84.39);
screw19.Pitch(17.58);
screw19.details(0.55);
// add screw in the scene
tool.Apply(0);
}

screw-prim.png
Screw Primitive

The result of code script see here

Screw-Nut

Copy this script to your local drive and run it from 3DCoat: "Script / Run Script". Don't know how to do that, check here.

void main() {
Coat coat;
UI ui;
//go to sculpt room
coat.room("Sculpt");
//clear the sculpt room
Vox vox1;
vox1.clearScene();
vox1.rename("Volume36");
vox1.toSurface();
//prepare the primitives tool
PrimitivesTool tool;
// go to primitives
ui("$SCULP_PRIM");
// create nut object
NutPrim nut20;
nut20 = tool.nut();
// custom mode
nut20.Custom();
// init axises
nut20.AxisX(Vec3(-0.59,0.36,-0.72));
nut20.AxisY(Vec3(0.81,0.26,-0.53));
nut20.AxisZ(Vec3(-0.00,-0.89,-0.45));
// init position
nut20.Position(Vec3(-30,0,0));
//other parameters
nut20.Name("hexa");
nut20.Diameter(233.01);
nut20.Height(116.51);
nut20.HeadType(SNutType::HEXA);
nut20.ThreadDiameter(155.34);
nut20.Pitch(19.42);
nut20.Profile(ProfileType::TRIANGLE);
nut20.UseThread(true);
// go to surface mode
vox1.toSurface();
// sets the detail level
nut20.details(0.61);
// add in the scene
tool.Apply(0);
}

screwnut-prim.png
Screw-Nut Primitive

The result of code script see here

Screw-Washer

Copy this script to your local drive and run it from 3DCoat: "Script / Run Script". Don't know how to do that, check here.

void main() {
Coat coat;
UI ui;
//go to sculpt room
coat.room("Sculpt");
//clear the sculpt room
Vox vox1;
vox1.clearScene();
vox1.rename("Volume36");
vox1.toSurface();
//prepare the primitives tool
PrimitivesTool tool;
// go to primitives
ui("$SCULP_PRIM");
// create screw washer
WasherPrim washer21;
washer21 = tool.washer();
// set custom mode
washer21.Custom();
// init parameters
washer21.Position(Vec3(-372.39,-60.71,-2.84));
washer21.Position2(Vec3(-372.39,-58.80,-2.24));
washer21.ScaleRadius(1.00);
washer21.Name("conus");
washer21.InnerDiameter(182.73);
washer21.OuterDiameter(365.46);
washer21.Thickness(31.84);
washer21.Height(47.75);
washer21.InnerDiameter2(301.79);
washer21.WasherType(SWasherType::CONUS);
washer21.details(0.61);
// change the parameters
washer21.Position(Vec3(-353.83,-60.71,-2.84));
washer21.Position2(Vec3(-353.83,-58.72,-2.22));
washer21.ScaleRadius(1.04);
washer21.InnerDiameter(190.18);
washer21.OuterDiameter(380.37);
washer21.Thickness(33.13);
washer21.Height(49.70);
washer21.InnerDiameter2(314.10);
// detail level
washer21.details(0.41);
// add screw washer in the scene
tool.Apply(0);
}

screwwasher-prim.png
Screw-Washer Primitive

The result of code script see here

Free Form

Copy this script to your local drive and run it from 3DCoat: "Script / Run Script". Don't know how to do that, check here.

void main() {
Coat coat;
UI ui;
//go to sculpt room
coat.room("Sculpt");
//prepare the scene
SculptRoom sculpt;
sculpt.toVoxel();
//clear the sculpt room
Vox vox1;
vox1.rename("Volume36");
vox1.toSurface();
//prepare the primitives tool
PrimitivesTool tool;
// go to primitives
ui("$SCULP_PRIM");
// create the freeform obj
FreeFormPrim ff32;
ff32 = tool.freeform("Blob:Blob2x2");
ff32.Transform(false);
ff32.SymmetryX(false);
ff32.SymmetryY(false);
ff32.SymmetryZ(false);
// init points
ff32.SetPoint(0,-51.67,-51.67,51.67);
ff32.SetPoint(1,-51.67,51.67,51.67);
ff32.SetPoint(2,51.67,51.67,51.67);
ff32.SetPoint(3,51.67,-51.67,51.67);
ff32.SetPoint(4,-51.67,-51.67,-51.67);
ff32.SetPoint(5,-51.67,51.67,-51.67);
ff32.SetPoint(6,51.67,51.67,-51.67);
ff32.SetPoint(7,51.67,-51.67,-51.67);
// 0 - index of "Blob2x2"
ff32.SubPrim(0);
//detail level
ff32.details(0.26);
// change point position
ff32.SetPoint(0,-97.98,-184.13,169.57);
ff32.SetPoint(1,-137.95,-23.70,192.67);
ff32.SetPoint(2,-75.81,-118.47,333.79);
ff32.SetPoint(3,25.56,-210.63,211.70);
ff32.SetPoint(4,-113.92,116.51,-214.19);
ff32.SetPoint(5,121.35,-253.16,-74.83);
ff32.SetPoint(6,172.05,6.77,-149.14);
ff32.SetPoint(7,125.49,-172.24,-62.55);
// add blob in the scene
tool.Apply(0);
}

freeform-prim.png
Free form Primitive

The result of code script see here

How to create a primitives in the Retopo Room

We can use for creating primitives the following classes:

Sphere

Copy this script to your local drive and run it from 3DCoat: "Script / Run Script". Don't know how to do that, check here.

void main() {
Coat coat;
// go to retopo room
coat.room("Retopo");
// clear retopo
RetopoRoom retopo;
retopo.clear();
// prepare the primitive tool
PrimitivesTool tool;
coat.room("Retopo");
// go to primitives
cmd("$RTP_PRIM");
// create sphere
rGeoSphere rsphere22;
rsphere22 = tool.rsphere();
//init parameters
rsphere22.useDiameter(false);
rsphere22.Position(Vec3(-273.63,0.00,0.00));
rsphere22.Radius(10.00);
rsphere22.SubDivision(0);
// set positions
rsphere22.Position(Vec3(-252.48,80.03,0.00));
// set a radius
rsphere22.Radius(120.15);
// set a subvisision
rsphere22.SubDivision(5);
// add sphere in the scene
tool.Apply();
}
rsphere-prim.png
Sphere Primitive

The result of code script see here

Cube

Copy this script to your local drive and run it from 3DCoat: "Script / Run Script". Don't know how to do that, check here.

void main() {
Coat coat;
// go to Retopo room
coat.room("Retopo");
// clear retopo
RetopoRoom retopo;
retopo.clear();
// prepare thw primitives tool
PrimitivesTool tool;
coat.room("Retopo");
// go to the primitives
cmd("$RTP_PRIM");
// create the box (cube)
rGeoBox rbox23;
rbox23 = tool.rbox();
// init axises
rbox23.AxisX(Vec3(1.00,0.00,0.00));
rbox23.AxisY(Vec3(0.00,1.00,0.00));
rbox23.AxisZ(Vec3(0.00,0.00,1.00));
rbox23.useUniform(true);
// position
rbox23.Position(Vec3(-226.48,32.41,0.00));
// sets the side
rbox23.SideA(64.79);
rbox23.SideB(64.79);
rbox23.SideC(64.79);
// init subdivisions
rbox23.DivX(1);
rbox23.DivY(1);
rbox23.DivZ(1);
rbox23.AverageDivision(1);
// change position
rbox23.Position(Vec3(-179.87,32.41,0.00));
// change sides
rbox23.SideA(85.72);
rbox23.SideB(85.72);
rbox23.SideC(85.72);
// change subdivisions
rbox23.DivX(7);
rbox23.DivY(7);
rbox23.DivZ(7);
rbox23.AverageDivision(7);
// add box in the scene
tool.Apply();
}
rbox-prim.png
Box Primitive

The result of code script see here

Cylinder

Copy this script to your local drive and run it from 3DCoat: "Script / Run Script". Don't know how to do that, check here.

void main() {
Coat coat;
// go to retopo room
coat.room("Retopo");
// clear retopo
RetopoRoom retopo;
retopo.clear();
// prepare the primitives tool
PrimitivesTool tool;
coat.room("Retopo");
// go to the primitives
cmd("$RTP_PRIM");
// create the cylinder
rGeoCylinder rcylinder24;
rcylinder24 = tool.rcylinder();
// init flags
rcylinder24.useDiameter(false);
rcylinder24.useFillet(false);
rcylinder24.RemoveCaps(false);
rcylinder24.useUniform(true);
// init positions
rcylinder24.startPoint(Vec3(-145.07,0.00,0.00));
rcylinder24.endPoint(Vec3(-145.07,20.00,0.00));
// init height,radius,topRadius,bottomRadius
rcylinder24.height(20.00);
rcylinder24.radius(10.00);
rcylinder24.topRadius(10.00);
rcylinder24.bottomRadius(10.00);
// init divisions
rcylinder24.DivY(3);
rcylinder24.DivX(1);
rcylinder24.DivZ(5);
rcylinder24.AverageDivision(3);
// change positions
rcylinder24.startPoint(Vec3(-145.07,-101.38,0.00));
rcylinder24.endPoint(Vec3(-145.07,45.82,0.00));
// sets height
rcylinder24.height(147.20);
// sets radius,topRadius,bottomRadius
rcylinder24.radius(72.82);
rcylinder24.topRadius(72.82);
rcylinder24.bottomRadius(72.82);
// sets divisions
rcylinder24.DivY(13);
rcylinder24.DivX(3);
rcylinder24.DivZ(20);
rcylinder24.AverageDivision(12);
// add in the scene
tool.Apply();
}
rcylinder-prim.png
Cylinder Primitive

The result of code script see here

Cone

Copy this script to your local drive and run it from 3DCoat: "Script / Run Script". Don't know how to do that, check here.

void main() {
Coat coat;
// go to retopo room
coat.room("Retopo");
// clear the room
RetopoRoom retopo;
retopo.clear();
// prepare the primitives tool
PrimitivesTool tool;
coat.room("Retopo");
cmd("$RTP_PRIM");
// create the cone
rGeoCone rcone25;
rcone25 = tool.rcone();
// init flags
rcone25.useDiameter(false);
rcone25.useFillet(false);
rcone25.useUniform(true);
// init start & end position
rcone25.startPoint(Vec3(0.00,0.00,0.00));
rcone25.endPoint(Vec3(0.00,20.00,0.00));
// height
rcone25.height(20.00);
rcone25.bottomRadius(10.00);
// scales = 1
rcone25.scalex(1.00);
rcone25.scaley(1.00);
// divisions
rcone25.DivY(5);
rcone25.DivX(1);
rcone25.DivZ(4);
rcone25.AverageDivision(3);
// sets fillet to "true"
rcone25.useFillet(true);
// sets fillet radius
rcone25.filletRadiusRelation(0.34);
rcone25.filletRadius(16.61);
// sets the positions
rcone25.startPoint(Vec3(-50.17,0.00,106.16));
rcone25.endPoint(Vec3(-50.17,161.35,106.16));
// sets the height
rcone25.height(161.35);
// sets the bottom radius
rcone25.bottomRadius(75.93);
// sets the count of divisions
rcone25.DivY(19);
rcone25.DivX(2);
rcone25.DivZ(14);
rcone25.AverageDivision(12);
// add in the scene
tool.Apply();
}
rcone-prim.png
Cone Primitive

The result of code script see here

Ellipse

Copy this script to your local drive and run it from 3DCoat: "Script / Run Script". Don't know how to do that, check here.

void main() {
Coat coat;
// go to Retopo room
coat.room("Retopo");
// clear retopo
RetopoRoom retopo;
retopo.clear();
//prepare the primitives tool
PrimitivesTool tool;
coat.room("Retopo");
// go to primitives
cmd("$RTP_PRIM");
// create the ellipse
rGeoEllipse rellipse26;
rellipse26 = tool.rellipse();
// init axes & position
rellipse26.AxisX(Vec3(1.00,-0.04,0.04));
rellipse26.AxisY(Vec3(0.04,1.00,-0.04));
rellipse26.AxisZ(Vec3(-0.04,0.05,1.00));
rellipse26.Position(Vec3(-279.27,11.38,-12.08));
// init sided
rellipse26.SideA(30.00);
rellipse26.SideB(30.00);
rellipse26.SideC(62.75);
// change axes
rellipse26.AxisX(Vec3(0.34,0.03,0.94));
rellipse26.AxisZ(Vec3(-0.94,0.06,0.34));
// change position
rellipse26.Position(Vec3(-283.85,16.57,98.84));
// add in the scene
tool.Apply();
}
rellipse-prim.png
Ellipse Primitive

The result of code script see here

Torus

Copy this script to your local drive and run it from 3DCoat: "Script / Run Script". Don't know how to do that, check here.

void main() {
Coat coat;
// go to the retopo room
coat.room("Retopo");
// clear the room
RetopoRoom retopo;
retopo.clear();
// prepare the primitives tool
PrimitivesTool tool;
coat.room("Retopo");
// go to the primitives
cmd("$RTP_PRIM");
// create the torus
rGeoTorus rtorus27;
rtorus27 = tool.rtorus();
// init axes
rtorus27.AxisX(Vec3(1.00,0.00,0.00));
rtorus27.AxisY(Vec3(0.00,1.00,0.00));
rtorus27.AxisZ(Vec3(0.00,0.00,1.00));
// set a uniform flag
rtorus27.useUniform(true);
// init position
rtorus27.Position(Vec3(0.00,0.00,0.00));
// init sides
rtorus27.SideA(30.00);
rtorus27.SideB(30.00);
rtorus27.SideC(30.00);
// init radius relation
rtorus27.RadiusRelation(0.50);
// init a outer,inner and profile radius
rtorus27.OuterRadius(30.00);
rtorus27.InnerRadius(15.00);
rtorus27.ProfileRadius(7.50);
// set a default division
rtorus27.AverageDivision(3);
// set the axes
rtorus27.AxisY(Vec3(0.00,0.28,-0.96));
rtorus27.AxisZ(Vec3(0.00,0.96,0.28));
// set the position
rtorus27.Position(Vec3(-194.37,-15.59,52.99));
// set a sides
rtorus27.SideA(112.28);
rtorus27.SideB(112.28);
rtorus27.SideC(112.28);
// set a outer, inner and profile radius
rtorus27.OuterRadius(112.28);
rtorus27.InnerRadius(56.14);
rtorus27.ProfileRadius(28.07);
// set an average division
rtorus27.AverageDivision(27);
// add torus in the scene
tool.Apply();
}
rtorus-prim.png
Torus Primitive

The result of code script see here

Capsule

Copy this script to your local drive and run it from 3DCoat: "Script / Run Script". Don't know how to do that, check here.

void main() {
Coat coat;
// go to retopo room
coat.room("Retopo");
// clear
RetopoRoom retopo;
retopo.clear();
// prepare the primitives room
PrimitivesTool tool;
coat.room("Retopo");
// go to primitives
cmd("$RTP_PRIM");
// create the capsule
rGeoCapsule rcapsule28;
rcapsule28 = tool.rcapsule();
// init parameters
rcapsule28.useDiameter(false);
rcapsule28.useUniform(true);
// positions
rcapsule28.startPoint(Vec3(0.00,0.00,0.00));
rcapsule28.endPoint(Vec3(0.00,20.00,0.00));
// height
rcapsule28.height(20.00);
// radius
rcapsule28.radius(10.00);
rcapsule28.topRadius(10.00);
rcapsule28.bottomRadius(10.00);
// scales & caps
rcapsule28.scalex(1.00);
rcapsule28.Cap1(1.00);
rcapsule28.scaley(1.00);
rcapsule28.Cap2(1.00);
// divisions
rcapsule28.DivY(2);
rcapsule28.DivZ(6);
rcapsule28.DivX(1);
rcapsule28.AverageDivision(3);
// sets the start & end positions
rcapsule28.startPoint(Vec3(-27.64,-37.33,156.80));
rcapsule28.endPoint(Vec3(-54.29,101.93,125.67));
// sets the height
rcapsule28.height(145.17);
// sets the radius
rcapsule28.radius(66.11);
rcapsule28.topRadius(66.11);
rcapsule28.bottomRadius(66.11);
// sets the count of divisions
rcapsule28.DivY(14);
rcapsule28.DivZ(39);
rcapsule28.DivX(10);
rcapsule28.AverageDivision(21);
// add in the scene
tool.Apply();
}
rcapsule-prim.png
Capsule Primitive

The result of code script see here

Tube

Copy this script to your local drive and run it from 3DCoat: "Script / Run Script". Don't know how to do that, check here.

void main() {
Coat coat;
// go to the retopo room
coat.room("Retopo");
// clear room
RetopoRoom retopo;
retopo.clear();
// prepare the primitives tool
PrimitivesTool tool;
coat.room("Retopo");
// go to primitives
cmd("$RTP_PRIM");
// create the tube
rGeoTube rtube29;
rtube29 = tool.rtube();
// init flags
rtube29.useDiameter(false);
rtube29.useFillet(false);
rtube29.useUniform(true);
// init start & end points
rtube29.startPoint(Vec3(0.00,0.00,188.41));
rtube29.endPoint(Vec3(0.00,119.83,188.41));
// set a height
rtube29.height(119.83);
// set a radius
rtube29.radius(85.30);
// set a top radius
rtube29.topRadius(85.30);
// set a bottom radius
rtube29.bottomRadius(85.30);
// set a wall thickness
rtube29.WallThickness(42.65);
// set scales to "1"
rtube29.scalex(1.00);
rtube29.scaley(1.00);
// set the number of divisions
rtube29.DivY(7);
rtube29.DivX(1);
rtube29.DivZ(16);
rtube29.AverageDivision(8);
// add in the scene
tool.Apply();
}
rtube-prim.png
Tube Primitive

The result of code script see here

NGon

Copy this script to your local drive and run it from 3DCoat: "Script / Run Script". Don't know how to do that, check here.

void main() {
Coat coat;
// go to retopo room
coat.room("Retopo");
// clear retopo room
RetopoRoom retopo;
retopo.clear();
// prepare the primitives room
PrimitivesTool tool;
coat.room("Retopo");
// go to primitives
cmd("$RTP_PRIM");
// create the n-gon
rGeoNGon rngon30;
rngon30 = tool.rngon();
// init flags
rngon30.useDiameter(false);
rngon30.useFillet(true);
rngon30.useUniform(false);
// set a bevel to "true"
rngon30.Bevel(1,true);
rngon30.Bevel(2,true);
// set a fillet(bevel) radiuses
rngon30.filletRadiusRelation(0.02);
rngon30.filletRadius(0.34);
// set the positions
rngon30.startPoint(Vec3(-34.32,-54.38,124.74));
rngon30.endPoint(Vec3(-18.28,125.10,124.74));
// set height, radius, topRadius, bottomRadius
rngon30.height(180.20);
rngon30.radius(73.82);
rngon30.topRadius(73.82);
rngon30.bottomRadius(73.82);
// set the number of edges (order)
rngon30.Order(15);
// number of segment for fillet
rngon30.FilletSegs(1);
// set the divisions
rngon30.DivY(14);
rngon30.DivX(5);
rngon30.DivZ(4);
// add in the scene
tool.Apply();
}
rngon-prim.png
NGon Primitive

The result of code script see here

Spiral

Copy this script to your local drive and run it from 3DCoat: "Script / Run Script". Don't know how to do that, check here.

void main() {
Coat coat;
// go to the retopo room
coat.room("Retopo");
// clear room
RetopoRoom retopo;
retopo.clear();
// prepare the primitives room
PrimitivesTool tool;
coat.room("Retopo");
// go to the primitives
cmd("$RTP_PRIM");
// create the spiral
rGeoSpiral rspiral31;
rspiral31 = tool.rspiral();
// init the axes
rspiral31.AxisX(Vec3(0.00,-0.49,-0.87));
rspiral31.AxisY(Vec3(1.00,0.00,0.00));
rspiral31.AxisZ(Vec3(0.00,-0.87,0.49));
// uniform is 'true'
rspiral31.useUniform(true);
// set the positions
rspiral31.Position(Vec3(-140.16,0.00,69.79));
rspiral31.Position2(Vec3(-140.16,1.75,68.82));
// use a circle profile
rspiral31.UseRectProfile(false);
// set a outer diameter
rspiral31.OuterDiameter(151.22);
// set a pitch & profile diameter & radius relation
rspiral31.Pitch(75.61);
rspiral31.ProfileDiameter(37.81);
rspiral31.ProfileRadiusRelation(0.50);
// set the number of turns
rspiral31.Turns(3);
// clockwise = 'true'
rspiral31.ClockWise(true);
// set a number of divisions
rspiral31.DivY(54);
rspiral31.DivX(18);
rspiral31.DivZ(8);
rspiral31.AverageDivision(37);
// add torus in the scene
tool.Apply();
}
rspiral-prim.png
Spiral Primitive

The result of code script see here