Math

Makerscad has useful mathematical functions, you can find them in the Math section of the menu

Number

In MakerSCAD there is a “Number”block, by default it has a zero but there you can enter de value that you need.

_images/number.png

Basic operations block

This block allows you to perform basic arithmetic operations between two numbers like addition (+), sustraction (-), multiplication (*), division and power, to use it simply write a number on each side of the block and select the desired sign from the dropdown at the center with the little triangle.

_images/basicoperations.png

you can use a variable and a 3D text (CAD - Parts - 3Dtext) like in the picture to see the result

_images/mathexample1.png

Advanced operations block

it includes operations like square root, absolute, negative, natural logarithm, log10, e power, 10 power, in this block you can snap another block with an expression, or simply write a number at the right of the block.
_images/advancedoperations.png

For this example lets start with the last example, add another variable block called “var2”, and then snap an “Advanced operations block” use the dropdown of the block to select “10ᶺ” and snap a block of “var2”, look at the picture as a reference

_images/mathexample2.png

Trigonometric functions

sin cos tan asin acos atan

Constants

pi, e, phi, sqrt(2) (sqrt1/2) infinity

even odd prime whole positive negative divisible by

change item: this block generates a programming expression that validates if a variable is a number and then adds the number indicated in the right of the block. if the variable is not a number, the block considers it as a zero

Round

This block allows to round a number or expression

Aggregation functions

block sum, min, max, average, modes, standar deviation, random item

Reminder

Constraint

Random

Random fraction