Skip to content
Snippets Groups Projects
Commit 1e3cf94e authored by Bas Pijls's avatar Bas Pijls
Browse files

Updates week3 documentation

parent 682ce31f
No related branches found
No related tags found
No related merge requests found
Showing
with 200 additions and 16 deletions
documentation/content/blog/week3/blender_cone.jpg

13.9 KiB

documentation/content/blog/week3/blender_icosphere_2.jpg

12.5 KiB

documentation/content/blog/week3/calculate_vertex_direction.jpg

12.4 KiB | W: | H:

documentation/content/blog/week3/calculate_vertex_direction.jpg

59.2 KiB | W: | H:

documentation/content/blog/week3/calculate_vertex_direction.jpg
documentation/content/blog/week3/calculate_vertex_direction.jpg
documentation/content/blog/week3/calculate_vertex_direction.jpg
documentation/content/blog/week3/calculate_vertex_direction.jpg
  • 2-up
  • Swipe
  • Onion skin
documentation/content/blog/week3/cube_pfk.jpg

63.6 KiB

documentation/content/blog/week3/icosphere_1.jpg

131 KiB

documentation/content/blog/week3/icosphere_1_pfk.jpg

80 KiB

......@@ -74,7 +74,7 @@ Blender has a powerful scripting engine. Most of its user-interface is written i
|I started with a template for an Export function|
|:-:|
|![blender_script_export_template](blender_script_export_template)|
|![blender_script_export_template](blender_script_export_template.jpg)|
This would give me a nice start to begin writing the export-to-openscad functionality. I changed the generic text-file code to:
......@@ -215,7 +215,7 @@ For each 2d projected vertex to have an optimal angle, I decided to calculate th
The average direction ```d``` is calculated by taking the sum of all direction vectors ```v_i``` pointing towards the connected vertices from the pivot vertex ```v_p``` and dividing the result by the amount of vconnected vertices to that pivot-vertex:
<p>\[d=\frac{1}{n}\sum_{i=1}^{n}\overline{\mathrm{V}_{i}} - \overline{V_{pivot}}\]</p>
<p>\[d_{avg}=\frac{1}{n}\sum_{i=1}^{n}\overrightarrow{{V}_{i}} - \overrightarrow{V}_{pivot}\]</p>
For a cube, one vertex would yield the following data:
......@@ -253,6 +253,8 @@ vertexData = [
### OpenSCAD
#### Vertex shape
I decided the basic vertex shape should be a circle. This would give the vertex enough body to accomodate the slots for several edges. The amount of edges a single vertex could have depends on the size of the vertex and the thickness of the material.
|A single corner of a cube was visualized in Rhino|
......@@ -266,38 +268,220 @@ Once the data generated by blender was loaded into openSCAD, the vertex "directi
- invert the rotation matrix.
- multiply all connected vertex directions by the inverted rotation matrix.
|Connected vertices with their average direction.| All connected vertices are transformed so the average direction points up (+z)|
|:-:|:-:|
|![calculate_vertex_direction](calculate_vertex_direction.jpg)|![transform_vertex_direction_1](transform_vertex_direction_1.jpg)|
In mathematical notation it might be something like:
<p>\[ \overrightarrow{y} = \begin{pmatrix} 0.2 \\ -0.4 \\ 0.7 \end{pmatrix} \]</p>
<p>\[\overrightarrow{z}=\overrightarrow{d}_{avg}\]</p>
<p>\[\overrightarrow{x}=\overrightarrow{z} \times \overrightarrow{x}\]</p>
<p>\[T=\begin{bmatrix}\overrightarrow{x} & \overrightarrow{y} & \overrightarrow{z} \\\end{bmatrix}\]</p>
<p>\[{v}_{connected}^{'}={v}_{connected} * T^{-1}\]</p>
Where ```d_avg``` is the average direction of all vertices. The ```y``` vector is chosen in a way to minimze the chance that this vector coincides with the average direction vector.
To make the final shape of the vertex I had to calculate the angle the transformed connected vertex direction would make with the z-axis:
|||
|:-:|
|![show_connected_vertex_angles](show_connected_vertex_angles.jpg)|
The z-axis angle ```beta``` was calculated using:
<p> \[\DeclareMathOperator{\atantwo}{atan2} \beta=\atantwo(v_{y}, v_{x}) \] </p>
#### Edge shape
Creating a vertex shape
Inverse transform based on vertex direction
Calculating the angles
The edge would be an elongated shape, like a rectangle with circular ends. The length of the edge was collected from the information generated by Blender. The angle of the slot would be calculated with the information from the transformed connected vertex direction data as angle ```alpha```. This angle can be calculated by:
Creating the edge shape
Calculating the angle
Calculating the bone structure
<p>\[d_{xy}= \begin{pmatrix} d_x \\ d_y \\ 0 \end{pmatrix}\]</p>
<p>\[\alpha = \arccos {\frac{d \bullet d_{xy}}{\left|d\right|\left|d_{xy}\right|}} \] </p>
### Testing
cube
ico_sphere tesselation 1
The first mesh shape I tested was a simple cube, because it would be possible for me to read and interpret the resulting data from the Blender export script. At this point I was not able to test it with the lasercutter so I had to generate the parts using a 3d printer.
|The output of the OpenSCAD script| The resulting shape|
|:-:|:-:|
|![cube_pfk](cube_pfk.jpg)| ![plastic_cube](plastic_cube.jpg)|
Pleased with the result I ran the script on an icoSphere at a tesselation level of 1:
|The output of the OpenSCAD script| The resulting shape|
|:-:|:-:|
|![icosphere_pfk](icosphere_1_pfk.jpg)| ![icosphere_1](icosphere_1.jpg)|
Quite pleased with the 3dprinted results I went to create other shapes with the lasercutter.
### Laser Cutter
Type
Procedures
The LaserCutter at the Waas is a BRM1612 and has the following characteristics:
- Type/model: BRM1612
- Max. work area: 1200x1600 mm
- Lasertype: CO2
- Power 100 W (Working life: 1500-3000 hrs)
- Adjustable height workbench: 300 mm
- Engraving Speed: 750 mm/sec
- Cutting speed: 400 mm/min
- Accuracy: Less than 0.01mm
- Scanner resolution: 50-1000 DPI
The controlboard was replaced and it is now operated by LightBurn software. LightBurn will accept SVG files without too much inconvenience.
#### Important parameters
Lasercutters operate by accurately moveing an assembly consisting of lenses and mirrors to reflect a beam, originating from the laser tube and focus it onto the material. To successfully cut any material, one has to take into account a couple of parameters:
|Parameter| Explanation|
|-|-|
|Type of material| Acrylic, cardboard, plywood, etc. If it doesn't give a colorful flame and dangeroes fumes, it can be cut|
|Material thickness| Measured in mm|
|Speed| Measured in mm/min, the speed of the moving assembly|
|Power| The amount of power output by the laser, measured in % from its maximum. Laser tubes degrade with use|
|Focus| A laserbeam might seem parallel but actually has a focal-point at which the beam can most optimally cut through material|
Also, linear and nonlinear deformations of the sheet material mus be taken into account.
Most of the decisions are all about speed and power. Higer speeds will make the process faster, but will also result in less laser energy transferred to your cut. High power will give a higher chance of charring the material while lower power will make it harder for the machine to cut material. As a rule of thumb, use the highest speed with the lowest power necessary to cut material.
#### Operating Procedure
To lasercut anything, the following procedure has to be followed:
|Step|Image|
|-|:-:|
|Turn on the machine by turning the key||
|Turn on the machine by pressing the button||
|The laser assembly will home and then move to the last position||
|Log in and start the LightBurn software||
|Insert a USB drive||
|Load an SVG into LightBurn||
|Decide what parts of the work will be cut or engraved differently by putting parts in layers||
|Set the speed and the power for each layer, according to the material and the desired effect (cutting or engraving)||
|Decide the origin of the piece. This will be the starting point of the laser||
|Insert the material||
|Make sure the material is as flat as possible. Use bricks if necessary||
|Use the focus-block to adjust the height of the laser assembly and ensure optimal focus||
|Perform a bounding-box test (```frame```) to be sure the piece fits the material and the assembly doesn't hit bricks||
|Close the lid||
|Turn on the fume extractor||
|Turn on the laser by pressing button no.3||
|Start the machine in LightBurn||
|Never leave the red area||
|When it's finished, leave the lid on for a minute to extract the fumes||
|Open the lid, remove your work and clean unused parts. Small parts can be vacumed||
#### Measuring the kerf
As thin as it might seem, a laser has some width and burns away material on both sides of the cut. There is actually some material lost and to make a well fitting press-fit, one has to know how much material is actually burned away in order tom compensate for that.
To determine the kerf, one can cut a piece of meterial with a knownintended width and measure the resulting width from the actual cut piece. The measurement becomes more accurate if multiple pieces are cut and the total loss of material is divided by the amount of pieces that were cut.
The material we set out to test was a piece of plywood, measured to be 3.6mm thick.
|A testpiece was made by drawing the lines directly in LightBurn|
|:-:|
|![kerftest_1](kerf_test_1.jpg)|
|At power 40, speed 40, the laser did not cut through the material| At speed 30, power 60, the material was cut.|
|:-:|:-:|
|![kerf_test_speed_40_power_40](kerf_test_speed_40_power_40.jpg)|![kerf_test_99_2mm](kerf_test_99_2mm.jpg)|
#### Testing the press-fit
To test the press-fit for the plywood material we drew a small test-jig in Rhino, which we could cut twice. We decicded to engrave the width of the slots so we could easily read which width would give the best fit. A chamfer of 0.5mm was added to the slots in order to help the slots to slide into place.
|The test-jig loaded into LightBurn| Two jigs fitted best at 3.2mm|
|:-:|:-:|
|![pfk_testjig](pfk_testjig.jpg)|![comb_test.jpg](comb_test.jpg)|
#### Lasercutting cones
Once the press-fit was tested and the kerf was known I could commence using the lasercutter for my mesh-press-fit-kit project. I started out by generating a cone. This was the first shape I tried with different lengths, angles and vertices. Up until now all shapes were uniform, needing only one type of edge and one type of vertex.
The material used for the cone was cardboard.
|Kit right out of the lasercutter| Loose parts| Way too small for cardboard|
|:-:|:-:|:-:|
|![cardboard_cone_kit](cardboard_cone_kit.jpg)|![cardboard_cone_parts_loose.jpg](cardboard_cone_parts_loose.jpg)|![cardboard_cone_too_small.jpg](cardboard_cone_too_small.jpg)|
It turned out I was way too optimistic regarding the size of the kit. I thought to save material by starting out small, but the internal structure of the material wold prevent it from forming a strong fit. The second try was roughly a factor 3 larger.
|The kit in the lasercutter| The resulting cone|
|:-:|:-:|
|![cardboard_laser_power_too_low.jpg](cardboard_laser_power_too_low.jpg)|![cardboard_cone_fail.jpg](cardboard_cone_fail.jpg)|
The second try seemed to work quite fine. The slots were a bit too wide but the structure held together pretty well. A problem became apparent because this was the first shape to be non-uniform. I assumed the vertices and the edges were perfectly in the center of all the lasercut shapes that make up the edges, but reality was different fro the perfect world of geometry. This resulted in the base of the cone being way to large. Eventually I made a small [bugfix to](https://gitlab.fabcloud.org/academany/fabacademy/2022/labs/waag/students/bas-pijls/-/commit/c4884c443590f203169503701ad73471aaeca687) the code in which the length of the edge gets compensated by the angle it makes with the vertex.
|The second cone was a bit better but still not resembling the original Blender cone. More work is needed.|
|:-:|:-:|
|![blender_cone](blender_cone.jpg)|![cardboard_cone.jpg](cardboard_cone.jpg)|
#### An ico-sphere
Testing kerf
Testing pressfit for MDF
The second project on the lasecutter was to make a larger, more complicated object on the lasercutter. Being only able to use a 3d printer before made me limited in the complexity of the shapes I could make, because it would take a very long time to make. On the lasercutter, a complex shape would take minutes instead of hours. I decided to do a larger ico-sphere so I wouldn't run into trouble having different edge lengths and vertices.
#### Lasercutting cone 1
|The icosphere in blender|The kit parts in LightBurn|
|:-:|:-:|
|![blender_icosphere_2.jpg](blender_icosphere_2.jpg)|![lightburn_big_sphere.png](lightburn_big_sphere.jpg)|
Assembling the sphere was quite a chore. There were two different kinds of edges, one slightly shorter than the other, and two different kinds of vertices, with 5 and with 6 slots. These had to be assembled in a specific manner in order to recrate the sphere.
|The sphere parts| Assembling the sphere|The final result|
|:-:|:-:|:-:|
|![assembling_a_sphere_0.jpg](assembling_a_sphere_0.jpg)|![assembling_a_sphere_1.jpg](assembling_a_sphere_1.jpg)|![cardboard_sphere.jpg](cardboard_sphere.jpg)|
#### Lasercutting cone 2
#### More complex shapes
In order to generate more complex meshes, two improvements need to be made:
1. Greater care must be taken to compensate for making a purely geometric object in real life. Slot depth, material thichness, etcetera. All those properties have an impact on how well the shape translates from the computer to the physical world.
2. Generating a kit from a complex shape is already possible. The only problem is to find all the fitting pieces when assembling the kit. I have made a start for a numbering system but I ran out of time to actually test this well enough. I had to make a special [font](https://gitlab.fabcloud.org/academany/fabacademy/2022/labs/waag/students/bas-pijls/-/blob/lc_press_fit_kit/lasercut_press_fit_kit/openscad_pkf_generator/simplenumber.scad) to accomodate for a large amount of characters that had to be generated by OpenSCAD.
### Vinyl cutting
I wanted to try and generate an image to then cut with the vinyl cutter.I came up wit a little [Processing](https://gitlab.fabcloud.org/academany/fabacademy/2022/labs/waag/students/bas-pijls/-/blob/lc_press_fit_kit/vinyl_maze/vinyl_maze/vinyl_maze.pde) sketch, generating a random maze from circles and rectangles.
|The output of the processing sketch| The resulting SVG from processing was unusable for cutting|
|:-:|:-:|
|![vinyl_maze_processing](vinyl_maze_processing.jpg)|![vinyl_maze_vector.png](vinyl_maze_vector.jpg)|
Using basic shapes resulted in am SVG file containing all those basic shapes. Every line would be a cutting path, making weeding an absolute chore. I tried to generate an SVG from the resulting bitmap from processign but wasn;t happy with the result. I also sacrificed a little time to find a processing library that allowed me to perform booleans on simple shapes. When that proved to be difficult I realized that OpenSCAD would fit my needs perfectly, so I ported the [algorithm to OpenSCAD](https://gitlab.fabcloud.org/academany/fabacademy/2022/labs/waag/students/bas-pijls/-/blob/lc_press_fit_kit/vinyl_maze/vinyl_maze.scad).
|The final maze in openSCAD|
|:-:|
|![vinyl_maze_openscad.png](vinyl_maze_openscad.jpg)|
I did't have time to perform the cutting at de Waag so I decided to use my own Vinyl cutter, a first generation Silhouette Cameo.
Silhouette Studio is the software that I used to control the cutting machine. It allowed me to import the SVG file expoerted from OpenSCAD. Based on the material I wante to cut I can manually set the cutting depth by removing the knife from the device and turning a scre to a set position. I set mine to 8.
|I enabled the option to over-cut sharp corners, to make sure weeding was possible|
|:-:|
|![vinyl_maze_silhouette.jpg](vinyl_maze_silhouette.jpg)|
The final result was a sticker, from which I had to remove all the material I didn't want to be part of my final design. This process is called "weeding"
|Weeding| The weeded result|
|:-:|:-:|
![vinyl_weeding.jpg](vinyl_weeding.jpg)|![vinyl_weeded.jpg](vinyl_weeded.jpg)|
The weeding process wasn't pleasurable at all because I chose to have the walls of the maze to be quite thin. A lot of material needed to be removed, ripping away pieces that I actually wanted to stay. Eventually I manage to weed all the unwanted parts from the sticker and end up with almost all of the parts that I wanted to keep.
Next was the process of transferring the design to my notebook.
|I applied transfer-foil to the weedes sticker...| and removed the backing.|
|:-:|:-:|
|![vinyl_apply_transfer](vinyl_apply_transfer.jpg)|![vinyl_remove_transfer](vinyl_remove_transfer.jpg)|
The result was quite painful. Sticking the design to my notebook I realized I probably had to degrease the surface with alcohol first. Furthermore, the really small loose parts were not inclined to stick to the surface at all.
|The final result failed spectacularly|
|:-:|
|![vinyl_final_fail.jpg](vinyl_final_fail.jpg)|
## Check
......
documentation/content/blog/week3/kerf_test_1.jpg

77.8 KiB

documentation/content/blog/week3/kerf_test_2.jpg

81.2 KiB

documentation/content/blog/week3/kerftest_3.jpg

68.7 KiB

documentation/content/blog/week3/lightburn_big_sphere.jpg

85.9 KiB

documentation/content/blog/week3/pfk_testjig.jpg

76 KiB

documentation/content/blog/week3/show_connected_vertex_angles.jpg

39.3 KiB

documentation/content/blog/week3/silhouette_interface.jpg

223 KiB

documentation/content/blog/week3/transform_vertex_direction_0.jpg

9.56 KiB

documentation/content/blog/week3/transform_vertex_direction_1.jpg

59.8 KiB

documentation/content/blog/week3/vinyl_apply_transfer.jpg

206 KiB

documentation/content/blog/week3/vinyl_final_fail.jpg

212 KiB

documentation/content/blog/week3/vinyl_remove_transfer.jpg

178 KiB

documentation/content/blog/week3/vinyl_weeded.jpg

67 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment