Hemnes Desk
The Hemnes desk is a simple design. It has a table top and three compartments for storage. The programming could be simple but because I tool a challenge to use egocentric movements only, so it takes more than two hours to complete. Another reason for the longer time taken was that during the construction, I actually found a bug in the VRMath2 Editor, which puzzled me with some strange behaviour of the turtle movement.
Below is the Hemnes desk 3D model. Please feel free to rotate and inspect.
The Logo programming codes are below with annotated comments.
; HEMNES Desk $399 ; Width: 155 cm; Depth: 65 cm; Height: 74 cm TO HEMNES ; remember location and direction MAKE "pos POS MAKE "ori ORI SETMAT 5 30 RU 90 FD 0.73 RD 90 SETSCALE 1.55 0.02 0.65 ; table top thickness 2 cm BOX RU 90 BK 0.03 RD 90 SETSCALE 1.44 0.04 0.6 ; table base top BOX LT 90 FD 0.695 RT 90 BK 0.275 RD 90 FD 0.35 RU 90 SETSCALE 0.05 0.7 0.05 ; table legs REPEAT 2 [ BOX FD 0.55 BOX RT 90 FD 0.30 RT 90 ] RT 90 FD 1.09 LT 90 REPEAT 2 [ BOX FD 0.55 BOX RT 90 FD 0.30 RT 90 ] ; 4 side panels FD 0.275 RT 90 FD 0.3 LT 90 RU 90 FD 0.07 RD 90 SETSCALE 0.05 0.52 0.50 BOX LT 90 FD 0.3 RT 90 BOX LT 90 FD 1.09 RT 90 BOX RT 90 FD 0.3 LT 90 BOX ; 2 back panels FD 0.275 LT 90 FD 0.15 RT 90 SETSCALE 0.25 0.52 0.05 BOX RT 90 FD 1.09 LT 90 BOX ; 2 bottom panels BK 0.3 RD 90 FD 0.235 RU 90 SETSCALE 0.25 0.05 0.55 BOX LT 90 FD 1.09 RT 90 BOX ; left door RU 90 FD 0.26 RD 90 BK 0.25 SETSCALE 0.24 0.46 0.05 BOX ; door knob RT 90 FD 0.09 RT 90 FD 0.03 LT 90 TL 90 SETMAT 14 27 SETSCALE 0.03 0.05 0.03 CAN ; 2 right doors ; top door SETMAT 5 30 TR 90 RT 90 BK 0.03 LT 90 FD 1 LT 90 RU 90 FD 0.138 RD 90 SETSCALE 0.24 0.184 0.05 BOX ; top door knob SETMAT 14 27 LT 90 FD 0.09 RT 90 BK 0.03 LT 90 TL 90 SETSCALE 0.03 0.05 0.03 CAN ; bottom door TR 90 RT 90 FD 0.03 LT 90 BK 0.09 RT 90 RD 90 FD 0.2325 RU 90 SETMAT 5 30 SETSCALE 0.24 0.271 0.05 BOX ; bottom door knob SETMAT 14 27 LT 90 FD 0.09 RT 90 BK 0.03 LT 90 TL 90 SETSCALE 0.03 0.05 0.03 CAN ; middle beam TR 90 LT 90 BK 0.03 RT 90 FD 0.45 RT 90 FD 0.5 RU 90 FD 0.27 RD 90 SETMAT 5 30 SETSCALE 0.9 0.12 0.05 BOX ; return to beginning location and direction SETPOS :pos SETHEADING :ori END CLEAN HOME RESET SETBG 29 SETWAIT 10 ; repeat 5 [ hemnes ; fd 1 ;] SHOWALL
As can be seen, the only information given for this desk is the three dimensions (Width: 155 cm; Depth: 65 cm; Height: 74 cm). Other dimensions are by estimation through the picture in the Furniture Visualisation Challenges. Line 85 SETWAIT 10 makes the turtle to move slower so if you run this program in VRMath2 Editor, you can observe its creation process.
The default unit for length is set as meter, therefore, you can see most of the numbers for moving (distance) or scale are decimals. The desk is also written in a procedure so it can be reused by simple copy the procedure into your other programs if needed.
The good thing about using egocentric movement is that this table can be created according to the turtle's beginning location and direction. This means that if you want to create a rotate desk, you can simply do RT 90 then HEMNES to get one.
Below are all the files, and you can also find the program collected in the Example -> Logo -> furniture folder in VRMath2 Editor.
Hemnes_desk.x3d Hemnes_Desk.logo
Please leave a commment below to let me know what you think. :-)
- Andy's blog
- Login or register to post comments
- 9158 reads