Hello, for this CAD assignment, I designed a skateboard to demonstrate my understanding of several CAD skills including, sketching, extruding, assemby, mechanical drawings, and creating a BOM. Here is my CAD project using Onshape:
I started by sketching the skateboard deck using the sketch tool. I drew a long rectangle and another two rectangles on each side. I used the construction tool to find the centre of my two additional rectangles and drew a line through that to find a middle point. I then created a half circle on that line.
Furthermore, I also sketched out the trucks in a seperate part studio and the wheels aswell.
EXTRUDE
Once my sketches were all complete, I first used to extrude tool to make my deck have curved edges. I was able to do this by slecting the parts that were not within the half circile and removing them with the extreude tool. I then extruded both the wheels and the truck.
ASSEMBLY
Next, I went into the assembly studiom to combine all my parts. I attached the trucks and wheels to the bottom of the deck using align and mate tools. I used the revolute tool to make sure that all my wheels were centered and attached to the truck. Finally this made the skateboard look like a real object that could actually roll.
MECHANICAL DRAWINGS
After completing the model, I created a mechanical drawing that includes:
Top view with full board dimensions
Side and front views showing wheel placement and angles
An Isometric view to show how the whole skateboard looks assembled
All relevant dimensions, such as the: deck lenght, deck thickness, wheel width, etc.. are clearly labeled. You can see these in my drawing below.
BILL OF MATERIALS (BOM)
I also included a bill of meaterial in my drawing. The BOM lists all the components used:
ITEM
QUANTITY
PART NUMBER
DESCRIPTION
1
1
Board 1
black paint on top
2
1
4 sets of wheels
This table helps identify what parts are needed to fabricate or 3D print the skateboard. For the wheels you will only need to print it once as it has 4 wheels in the part’s studio. You can also choose to paint the top of you skateboard black to better identity which side is the top or bottom.
This is my flowchart and my process of ideas on how I wanted to make my game and how the user would “win” the game
Below is the code that I used to create my game. However, you do need to instal a libary called tkinter or else it will not work. For some people they are unable to do that. Thus I have recorded a yotube video that will go over my code and game. Here is the video.
Here is my code
CODE
import tkinter as tk
# Player inventory, accessible by all functions. inventory = { “gold”: 0, “sword”: False, “biscuit”: False, “strange_key”: False }
def clear_screen(): for widget in root.winfo_children(): widget.destroy()
# — Functions for Game Choices —
def fight_the_bear(): clear_screen()
if inventory[“sword”] == True: story_text = “You draw the sharp sword you found in the chest and kill the bear good job”
continue_button = tk.Button(root, text=”Search the Cave”, command=bear_cave_chest) continue_button.pack() else: story_text = “You try fighting the bear with your fists?? wow no surpise you get clapped and died L noob.”
clear_screen() inventory[“strange_key”] = True story_label = tk.Label(root, text=”Deeper in the cave, you find the bear’s treasure chest. Inside is a strange key.”) story_label.pack()
back_button = tk.Button(root, text=”Take key and go back”, command=start_game) back_button.pack()
def hide_from_bear(): clear_screen()
if inventory[“biscuit”] == True: story_text = “you hide and live off the biscut. a hunter comes and saves you, you win!” else: story_text = “You hide but you died of starvation, L noob”
def wolf_attack(): clear_screen() story_label = tk.Label(root, text=”You hear some howls, you get surrounded by wolves and you died L noob.”) story_label.pack() play_again_button = tk.Button(root, text=”Play Again”, command=start_game) play_again_button.pack()
def meet_bear(): clear_screen() story_label = tk.Label(root, text=”You see a big brown bear.”) story_label.pack() fight_button = tk.Button(root, text=”Fight the bear”, command=fight_the_bear) fight_button.pack() hide_button = tk.Button(root, text=”Try to hide”, command=hide_from_bear) hide_button.pack()
def deeper_in_cave(): clear_screen() story_label = tk.Label(root, text=”The cave is damp and you hear a strange noise.”) story_label.pack() continue_button = tk.Button(root, text=”Follow the noise”, command=meet_bear) continue_button.pack()
def go_in_spooky_cave(): clear_screen() story_label = tk.Label(root, text=”You step into the spooky cave…”) story_label.pack() continue_button = tk.Button(root, text=”Continue”, command=deeper_in_cave) continue_button.pack()
def leave_spooky_cave(): clear_screen() story_label = tk.Label(root, text=”You decide not to risk it and leave.”) story_label.pack() continue_button = tk.Button(root, text=”You walk for some time…”, command=wolf_attack) continue_button.pack()
def open_chest(): global inventory clear_screen() inventory[“gold”] += 1 inventory[“sword”] = True story_text = f”You open the chest and find a sharp sword and 1 gold piece!\n(Gold: {inventory[‘gold’]})” story_label = tk.Label(root, text=story_text) story_label.pack() back_button = tk.Button(root, text=”Go Back”, command=start_game) back_button.pack()
def try_door(): clear_screen()
if inventory[“strange_key”] == True: # WINNER: The player has the key story_text = “You place the sdFSDFDF0101 F key sdFsda0101fS in” story_label = tk.Label(root, text=story_text) story_label.pack() story_text = “you’ve escaped the matrix! … or have U?” story_label = tk.Label(root, text=story_text) story_label.pack()
def show_credits(): clear_screen() story_label = tk.Label(root, text=”Game Created By Tiger wei and thanks to gemeni!\n\nThanks for playing.”) story_label.pack()
def go_away(): clear_screen() story_label = tk.Label(root, text=”You walk the other way towards a crossroad.”) story_label.pack() continue_button = tk.Button(root, text=”Continue”, command=find_spooky_cave) continue_button.pack()
def meet_trader(): global inventory clear_screen() if inventory[“gold”] >= 1: story_text = f”The shady trader sees your gold.\n’Care for a biscuit? Just 1 gold piece.’\n(You have: {inventory[‘gold’]} gold)” story_label = tk.Label(root, text=story_text) story_label.pack() live_button = tk.Button(root, text=”Trade with him”, command=live) live_button.pack() away_button = tk.Button(root, text=”No thanks”, command=go_away) away_button.pack() else: story_text = f”The shady trader looks you over, sees you have no gold, and scoffs.\n’Don’t waste my time.’\n(You have: {inventory[‘gold’]} gold)” story_label = tk.Label(root, text=story_text) story_label.pack() back_button = tk.Button(root, text=”Go Back”, command=go_right) back_button.pack()
def go_left(): clear_screen() story_label = tk.Label(root, text=”You walk down a path and find a shiny key.”) story_label.pack() chest_button = tk.Button(root, text=”Open Chest”, command=open_chest) chest_button.pack() door_button = tk.Button(root, text=”Try Door”, command=try_door) door_button.pack() back_button = tk.Button(root, text=”Go Back”, command=start_game) back_button.pack()
def go_right(): clear_screen() story_label = tk.Label(root, text=”You walk towards a river. The water is flowing quickly.”) story_label.pack() trader_button = tk.Button(root, text=”Meet the shady trader”, command=meet_trader) trader_button.pack() away_button = tk.Button(root, text=”Go away from the river”, command=go_away) away_button.pack() back_button = tk.Button(root, text=”Go Back”, command=start_game) back_button.pack()
def start_game(): clear_screen() story_label = tk.Label(root, text=”You wake up in a dark forest. You can go left or right.”) story_label.pack() left_button = tk.Button(root, text=”Go Left”, command=go_left) left_button.pack() right_button = tk.Button(root, text=”Go Right”, command=go_right) right_button.pack()
# — Main Program Setup — root = tk.Tk() root.title(“My Adventure Game”) root.geometry(“400×300”)
Here I will explain what all my code does in a very simple manner so that everyone can understand
Libraries
for this project, you need to install the tinker library for python. If u do not, this code will not work. Here is a link to the library so you can download it
This code creates our inventory and allows for different results in our game. We can set these items to 0 or false
def clear_screen(): for widget in root.winfo_children(): widget.destroy()
This code creates a function that erases the screen after a choice is made and we use this everytime we’ve made a choice in the game
FUNCTIONS
In my game I have alot of functions like
EX.
def fight_the_bear() :
def hide_from_bear() :
def go_left() :
def go_right() :
each of theese functions are like pages in our story. Each of these functions is the pages that allow the player to choose between 2 actions
MAIN REPEATED CODE
In my game all of the options and text afterwards are all construced by 4 different set of codes
story_label = tk.Label(root, text=)
this code makes the lines of text you see before you click on one of the buttons
X_button.pack()
This code makes our buttons actually function and acts like a hand that flips the page after each choice
Story_text = X
This is the code that displays a longer line of text after you have clicked on one of the buttons and made your choice
X_Button = tk.Button(root, text=””z, command =Y)
This is one of teh msot important part’s of our code. This code creates the buttons for our game. X has to be part of one of our functions so that it can connect back to it. Z is the text that will be displayed on the button (EX. Go left). Y is the next function or scene we want to go to after we click on this button (EX. We click on go left Go Left => Open Chest) we would put Open_Chest where Y is and it would lead us to that scene.
More EX.
continue_button = tk.Button(root, text=”Follow the noise”, command=meet_bear)
This will display a continue button and move us to the scene where we meet the bear