Please enable JavaScript to view this site.

Knowledge Bridge Documentation

Help version: 3.3.8

 

 

EXERCISE: BooleanSolid                                                      

Create a new Project

Create a new project and name it BooleanSolidExample

 

EXERCISE: BooleanSolid                                                      

Create Designs

Create 5 new designs

 

BlockOne (add Block design as a mixin)
BlockTwo (add Block design as a mixin)
BlockThree (add Block design as a mixin)
BlockFour (add Block design as a mixin)
BooleanSolidOne (add BooleanSolid design as a mixin)

 

 

 

EXERCISE: BooleanSolid                                                        

TREE STRUCTURE

 

Drag and drop the designs just created into BooleanSolidExample.

Your tree should look like this (minus the MyMaterial).

 

BooleanSolid4

 

 

 

 

EXERCISE: BooleanSolid                                                        

RULES FOR BOOLEANSOLIDEXAMPLE

 

Add these rules and values to BooleanSolidExample.

height:

Name:             height

Type:              number

Flags:             cached,parameter

Category:       UI Specs

default value:   return 12;

length:

Name:             length

Type:              number

Flags:             cached,parameter

Category:       UI Specs

default value:   return 72;

width:

Name:             width

Type:              number

Flags:             cached,parameter

Category:       UI Specs

default value:   return 36;

LegHeight:

Name:             LegHeight

Type:              number

Flags:             cached,parameter

Category:       UI Specs

default value:   return 36;

LegLength:

Name:             LegLength

Type:              number

Flags:             cached,parameter

Category:       UI Specs

default value:   return 3.5;

LegWidth:

Name:             LegHeight

Type:              number

Flags:             cached,parameter

Category:       UI Specs

default value:   return 3.5;

ShowToolSolids:

Name:             ShowToolSolids

Type:              boolean

Flags:             cached,parameter

Category:       Show?

default value:   false;

ShowBowl:

Name:             ShowBowl

Type:              boolean

Flags:             cached,parameter

Category:       Show?

default value:   false;

 

EXERCISE: BooleanSolid                                                        

PARAMETERS FOR THE CHILD RULES

Supply the values to the following:

 

BlockOne:

height: this.height;
length: this.length;
width: this.length;
show: R.rootModel.ShowToolSolids;

 

BlockTwo:

height: this.height-1.5;
length: (this.length-3-.75)/3;
width: this.width-1.5;
show: R.rootModel.ShowToolSolids;
color: 'silver'

 

 

BlockThree:

height: R.rootModel.BlockTwo.height;
length: R.rootModel.BlockTwo.length;
width: R.rootModel.BlockTwo.width;
show: R.rootModel.ShowToolSolids;
color: 'gold'
position: var x = (this.length-0.375)/3;
               return {origin: p(-x+0.25,0,0), xdir: v(1,0,0), ydir: v(0,1,0)};

 

BlockFour:

height: R.rootModel.BlockTwo.height;
length: R.rootModel.BlockTwo.length;
width: R.rootModel.BlockTwo.width;
show: R.rootModel.ShowToolSolids;
color: 'lime'
position: var x = (this.length-.375)/3;
               return {origin: p(x-.25,0,0), xdir: v(1,0,0), ydir: v(0,1,0)};

 

 

 

 

In the images it shows BlockOne, which will be used as the 'target' and BlockTwo,BlockThree and BlockFour which will be used as the 'tools'

in the BooleanSolidOne.

 

BooleanSolid5BooleanSolid6

 

 

EXERCISE: BooleanSolid                                                        

Operation: Difference

 

BooleanSolidOne:

operation: 'Difference';
target: this.BlockOne;
tools: var firstArray = [
               R.rootModel.BlockTwo,
               R.rootModel.BlockThree,
               R.rootModel.BlockFour
               ];
               return firstArray;
show: true;
color: 'tan'

 

Set the view to Hidden Lines Dashed and you can see the BlockOne has been modified by the 'tools' [BlockTwo,BlockThree,BlockFour]

What remains is a shell 3/4 inch thick and 2 interior support panes, both 3/4 inch thick.

 

BooleanSolid7

 

 

EXERCISE: BooleanSolid                                                        

OPERATION: UNION

 

Next we'll make a SideCutout that will use the 'Union' operation. The 'Union' operation will use

2 Cylinders and a Block to combine into one solid model. This SideCutout will later be used in

the 'tools' rule to cutout or 'Difference' the BooleanSolidOne design.

 

 

BooleanSolid8BooleanSolid9

 

 

 

EXERCISE: BooleanSolid                                                      

Create Design

Create 1 new design

 

SideCutout

 

Drag and drop the design just created (SideCutout) into BooleanSolidExample and Name it SideCutout1.

 

Drag and drop Block from the Project window into SideCutout1.

 

Drag and drop Cylinder from the Project window into SideCutout1 and Name it Cylinder1.

 

Drag and drop Cylinder from the Project window into SideCutout1 and Name it Cylinder2.

 

Drag and drop BooleanSolid from the Project window into SideCutout1 and Name it BooleanSolidSideCutout.

 

 

 

BooleanSolid10

 

EXERCISE: BooleanSolid                                                        

PARAMETERS FOR SIDECUTOUT1

Supply the values to the following:

 

SideCutout1:

position: { origin: p(0, 0, 0, this.parent.transform ) };
color: 'blue'
height: R.rootModel.BlockOne.height-4;
length: (R.rootModel.length-8)/3  - child.height;
width: R.rootModel.BlockOne.width+3;
show: R.rootModel.ShowToolSolids;

 

 

EXERCISE: BooleanSolid                                                        

PARAMETERS FOR THE CHILD RULES

Supply the values to the following:

 

Block:

height: this.height;
length: this.length;
width: this.length;

 

BooleanSolidSideCutout:

operation: 'Union'
target: this.Block;
tools: [this.Cylinder1,this.Cylinder2];

 

Cylinder1:

height: var x = this.Block.width;
               return x;
radius: var x = this.Block.height/2;
               return x;
position: var x = this.Block.length/2;
               return {origin: p(x,0,0), xdir: v(0,0,1), ydir: v(1,0,0)};

 

Cylinder2:

height: var x = this.Block.width;
               return x;
radius: var x = this.Block.height/2;
               return x;
position: var x = this.Block.length/2;
               return {origin: p(-x,0,0), xdir: v(0,0,1), ydir: v(1,0,0)};

 

Image shows SideCutout1 in blue.

 

BooleanSolid11

 

 

Drag and drop the design already created (SideCutout) into BooleanSolidExample and Name it SideCutout2.

Drag and drop the design already created (SideCutout) into BooleanSolidExample and Name it SideCutout3.

Drag and drop the design already created (SideCutout) into BooleanSolidExample and Name it SideCutout4.

 

EXERCISE: BooleanSolid                                                        

PARAMETERS FOR SIDECUTOUT2

Supply the values to the following:

 

SideCutout2:

position: var x = (R.rootModel.length-8) /3 + 2
               return { origin: p(-x, 0, 0, this.parent.transform ) };
color: 'Green'
height: R.rootModel.SideCutout1.height;
length: R.rootModel.SideCutout1.length;
width: R.rootModel.SideCutout1.width;
show: R.rootModel.ShowToolSolids;

 

EXERCISE: BooleanSolid                                                        

PARAMETERS FOR SIDECUTOUT3

Supply the values to the following:

 

SideCutout3:

position: var x = (R.rootModel.length-8) /3 + 2
               return { origin: p(x, 0, 0, this.parent.transform ) };
color: 'Orange'
height: R.rootModel.SideCutout1.height;
length: R.rootModel.SideCutout1.length;
width: R.rootModel.SideCutout1.width;
show: R.rootModel.ShowToolSolids;

 

EXERCISE: BooleanSolid                                                        

PARAMETERS FOR SIDECUTOUT4

Supply the values to the following:

 

SideCutout4:

position: {origin: p(0,0,0), xdir: v(0,1,0), ydir: v(1,0,0)}
color: 'Cyan'
height: R.rootModel.BlockOne.height-4;
length: (R.rootModel.BlockOne.width-4)  - child.height;
width: R.rootModel.BlockOne.length+3;
show: R.rootModel.ShowToolSolids;

 

 

 

BooleanSolid12

 

 

Update the BooleanSolidOne design

BooleanSolidOne:

operation: 'Difference';        (Same)
target: this.BlockOne;        (Same)
tools: var firstArray = [
R.rootModel.BlockTwo,
R.rootModel.BlockThree,
R.rootModel.BlockFour
];
var secondArray = [
R.rootModel.BlockTwo,
R.rootModel.BlockThree,
R.rootModel.BlockFour,
R.rootModel.SideCutout1.BooleanSolidSideCutout,
R.rootModel.SideCutout2.BooleanSolidSideCutout,
R.rootModel.SideCutout3.BooleanSolidSideCutout,
R.rootModel.SideCutout4.BooleanSolidSideCutout
];
 
       //return firstArray;
return secondArray;
 
show: true;        (Same)
color: 'tan'        (Same)

 

 

Image shows 1 target and 7 tools used with the operation set to 'Difference'.

BooleanSolid13

 

EXERCISE: BooleanSolid                                                        

OPERATION: INTERSECTION

 

 

Next we'll make a LegIntersection that will use the Intersection operation. The Intersection operation will use

1 Cylinder as the 'tools' and 1 Block as the 'target' to make one solid model. Only the areas that Intersects are kept.

 

 

 

 

BooleanSolid14BooleanSolid15BooleanSolid16

 

 

EXERCISE: BooleanSolid                                                      

Create Design

Create 1 new design

 

LegIntersection (add Block design as a mixin)

 

Drag and drop the design just created (LegIntersection) into BooleanSolidExample and set the Quantity to 4.

 

Drag and drop Block from the Project window into LegIntersection.

 

Drag and drop Cylinder from the Project window into LegIntersection .

 

Drag and drop BooleanSolid from the Project window into LegIntersection.

 

 

EXERCISE: BooleanSolid                                                        

ADD RULE FOR LEGINTERSECTION

Add the rule (CylinderPosition) with these values:

CylinderPosition:

Name:CylinderPosition                
Type:             any
Flags:             cached,parameter
Category:       Position
default value:   { origin: p(0, 0, 0, this.parent.transform ) }

 

EXERCISE: BooleanSolid                                                        

PARAMETERS FOR LEGINTERSECTION

Supply the values to the following:

 

LegIntersection:

height: this.LegHeight;
length: this.LegLength;
width: this.LegWidth;
CylinderPosition:

var x;

if (child.index === 0){

   x = R.rootModel.BlockOne.vertexLBD.x+child.width;

}   else if (child.index ==1){

   x = R.rootModel.BlockOne.vertexRBD.x-child.width;

}   else if (child.index ==2){

   x = R.rootModel.BlockOne.vertexLFD.x+child.width;

}   else if (child.index ==3){

   x = R.rootModel.BlockOne.vertexRFD.x-child.width;

}

 

var y;

if (child.index === 0){

   y = R.rootModel.BlockOne.vertexLBD.y-child.width;

}   else if (child.index ==1){

   y = R.rootModel.BlockOne.vertexRBD.y-child.width;

}   else if (child.index ==2){

   y = R.rootModel.BlockOne.vertexLFD.y+child.width;

}   else if (child.index ==3){

   y = R.rootModel.BlockOne.vertexRFD.y+child.width;

}

 

var z;

if (child.index === 0){

   z = R.rootModel.BlockOne.vertexLBD.z-child.height/2;

}   else if (child.index ==1){

   z =  R.rootModel.BlockOne.vertexRBD.z-child.height/2;

}   else if (child.index ==2){

   z =  R.rootModel.BlockOne.vertexLFD.z-child.height/2;

}   else if (child.index ==3){

   z =  R.rootModel.BlockOne.vertexRFD.z-child.height/2;

}

 

return { origin: p(x, y, z, this.parent.transform )};

 
position:

var x;

if (child.index === 0){

   x = R.rootModel.BlockOne.vertexLBD.x+child.width/2;

}   else if (child.index ==1){

   x = R.rootModel.BlockOne.vertexRBD.x-child.width/2;

}   else if (child.index ==2){

   x = R.rootModel.BlockOne.vertexLFD.x+child.width/2;

}   else if (child.index ==3){

   x = R.rootModel.BlockOne.vertexRFD.x-child.width/2;

}

 

var y;

if (child.index === 0){

   y = R.rootModel.BlockOne.vertexLBD.y-child.width/2;

}   else if (child.index ==1){

   y = R.rootModel.BlockOne.vertexRBD.y-child.width/2;

}   else if (child.index ==2){

   y = R.rootModel.BlockOne.vertexLFD.y+child.width/2;

}   else if (child.index ==3){

   y = R.rootModel.BlockOne.vertexRFD.y+child.width/2;

}

 

var z;

if (child.index === 0){

   z = R.rootModel.BlockOne.vertexLBD.z-child.height/2;

}   else if (child.index ==1){

   z =  R.rootModel.BlockOne.vertexRBD.z-child.height/2;

}   else if (child.index ==2){

   z =  R.rootModel.BlockOne.vertexLFD.z-child.height/2;

}   else if (child.index ==3){

   z =  R.rootModel.BlockOne.vertexRFD.z-child.height/2;

}

 

return { origin: p(x, y, z, this.parent.transform )};

 

EXERCISE: BooleanSolid                                                        

PARAMETERS FOR THE CHILD RULES

Supply the values to the following:

 

 

BooleanSolid:

operation: 'Intersection'
target: this.Block;
tools: [this.Cylinder];

 

Cylinder:

height: this.height;
radius: this.width;
position: this.CylinderPosition;
show: R.rootModel.ShowToolSolids;

 

Block:

height: this.height;
length: this.length;
width: this.width;
show: R.rootModel.ShowToolSolids;

 

 

Set the LegIntersection design to a Quantity of 4.

 

BooleanSolid17

 

If the BooleanSolidOne  rule 'show' was set to false to build the LegIntersection,  set 'show' to true to display the bench top.

 

BooleanSolid19

 

All three operations were used to create this workbench.

Difference
Union
Intersection

 

 

 

BooleanSolid20

 

 

 

BooleanSolid18

 

Knowledge Bridge from Engingeering Intent is a full-featured engineering and sales automation environment