homescreen.

welcome.

  • Making Sunglasses Using OnShape CAD Software

    See what I made: https://sgs.onshape.com/documents/5156a498a2aba7f7434cf364/w/bd97c332939ff0f186f17f32/e/bb76bdfb270675c601e3e98b?bomType=structured&renderMode=0&rightPanel=BOMPanel&uiState=68e4ac22145f236ad973de3f

    Our latest project with Fusion was to choose any object and create it with OnShape. OnShape is a CAD software, which means it is meant to be used to create 3D models of things in a computer. This software is useful for 3D printing and industrial manufacturing because you can make one design and then have it be printed or manufactured.

    I, the ambitious person I am, decided to make sunglasses. It took me about 5 hours of learning and 10 hours of designing, but it all came together into a questionable looking pair of sunglasses.

    What I Built

    I built a pair of sunglasses. The design is inspired by one of my sunglasses at home. I like the wide lenses that cover a lot of your face.

    Unfortunately, they do not come with a lens, but they are made as if a lens will go in there. When I built it, I included a slot for the lens to go right into.

    How I Made the Sunglasses

    It took me 10 hours to build the sunglasses because this is my first time doing CAD. It’s harder than it looks, and I learned that the hard way.

    I started by drawing out the shape of the front frame, I left the temple sticks for later as a separate part. I only drew half of it out because I would later mirror it to make the full shape.

    After drawing the shape out, I performed something called extrusion.

    Extrusion is the premise of OnShape and CAD in general. You begin by drawing a 2D shape, and then you extrude that into a 3D shape.

    Next, I work on the holder for the lens. To do this, I cut into the frame just slightly so that there can be a way for the lens to fit right in to the frame. This makes it easier to later work on the lens.

    After the main part of the frame is done, I need to make the “door hinge” part to allow the sunglasses to connect to the temples. To do this I create a small part that sticks out of the frame and put a hole into it.

    This will allow me to soon attach the temples to the sunglasses frame.

    Next I mirror the half over, and I’m done the main frame.

    After mirroring it over, I start to work on the temples. I begin, again, with a sketch of the shape of it.

    This is a very basic sketch but that’s okay because after this, I can extrude it into a 3D version of this that has a Z-axis. Once that is done I can perform something called a fillet which will give the important detail. It turns sharp angles into smooth curves.

    I also add the part that will soon be connecting to the connector part we added earlier to the main frame. The temple is almost done. All I need to do is put the hole down the middle and cut out a section the same size as the connector on the main frame.

    Now our temple is done. To get the temple for the other side, I just duplicated this part studio and mirrored it.

    The next step is to assemble everything together. To do this, we go to the assembly tab and add all the pieces in. Then, we add mate connectors to connect the temples to the main frame.

    And there you have it, a perfect pair of sunglasses.

    Above is the Mechanical Drawing which shows all the angles of the sunglasses from a 2D “Drawing” style which is useful for manufacturers who can easily understand what they are dealing with just by seeing this drawing.

    This is my Bill of Materials(BOM) which has all the information about each part of my sunglasses assembly.

    Reflection

    The biggest thing this project taught me was patience. I kept on trying to go fast and when something wouldn’t work for me, I’d get really annoyed. Slowly as I worked on it, I got better at slowing down, understanding the problem, and building up from there.

    When you understand what specifically you are doing, it is so much easier to fix the problem. When you don’t actually know the problem, then it is just really annoying to do.

    Even though my sunglasses don’t really look good, I am very proud of them because this was my first time doing CAD, and I was able to take this from idea to 3D model and ready for manufacturing, all by myself.

    AI Transcript

    https://docs.google.com/document/d/1vYapEw0pTBEKJ8PKU6ysRHlsPKElSyx76OjCtVkRq8c/edit?tab=t.0

  • Using Flowcharts to Plan and Build a Game with Python

    Try it out: https://colab.research.google.com/drive/12I-ZFEEjzt6dRUjXNlNHPGqkT9HTQBp_?authuser=0#scrollTo=x5tJeoiCjnPT

    Our first assignment in the Fusion 10 class was a freestyle coding project. I set out to make a text-based adventure game. It follows a character who enters the dungeon to get a magic item. But in order to get to the item, they must pass through a number of rooms, with challenges sprinkled throughout.

    Before I began to code, I started with a flowchart. This is an essential part of any coding project because it outlines the project, giving you a focused way to work individually on each part of the project until the whole of the project is complete.

    This flowchart shows the outline of my game idea. Once I had this written out, it made it much quicker to work on the project itself. The coding was very quick and I just went from one part to another.

    The Code

    Once I had a general plan from my flowchart, I just coded a part, tested it, fixed it, and went to the next part.

    Setting the Stage with Variables

    Variables are used to set the state of something. Here, I used the first half of this snippet to set the state of the player.

    • Inventory starts empty.
    • Health starts at 100 and max_health makes sure it can’t go any higher.
    • Gold starts at 0
    • Events is a list of the room options: a monster encounter, a lucky chest, a valuable merchant, or a benevolent healing room.

    The rest after that is lists of items and monsters. Artifacts are used as the item you look for during a quest. The numbers next to them represent how many rooms you need to clear to find the item. After that, it shows the monster or item and the numbers beside them are the stats.

    Talking with the Player

    There are three main functions used to communicate with the player.

    • The typewriter() function gives the game a more interesting way to it by writing the text in a letter by letter way instead of all at once. This makes the game more immersive.
    • The GateKeeper() function is used to keep communication from the gatekeeper consistent.
    • The Game() function is used to keep communication about the game consistent. This is mainly description.

    The player function is important. This is how to receive input from the player to make the game more interactive. It works by receiving an input of a list of options and then the player chooses which option they would like to say.

    Logic Behind the Dungeon Rooms

    For the Chest() room, I wanted it to always give a weapon, a potion and a number of coins. To determine the weapon and potion, it chooses a random one out of the list that we defined earlier as a variable.

    The HealRoom() brings you closer to max health. After a fight with a monster, this is one way to heal your health to prepare for another fight. It works by saving the old health in a variable, then adding the heals to the old health. If that is more than max_health, then it sets health to max_health, otherwise, it just leaves it.

    The Merchant() room is a way for players to buy equipment to keep them better prepared for future fights with monsters. First I define a list of items that you can buy from the merchant. Then, it runs through a loop. It asks what item you would like to buy, then makes sure you have the gold to buy that item. If you do, then it gives it to you and takes away the gold.

    The last and most complicated room is the Monster() encounter room. It first types out the stats of both you and the monster then it does the combat in the combat function, which I will get to later. It then goes on to print if the player won, if the monster won, or if it was a stalemate.

    The Combat Function

    The Combat() function starts by getting the stats of both the player and the monster. Then, it lists out the controls that the player can use. I made combat a turn by turn based fight. The player has the option of all these controls. After the player inputs a move, the monster makes a move and there is a small chance it does a lot of damage.

    The code above is how the game understands what key is pressed.

    • When “c” is pressed, it shows a list of controls
    • When “i” is pressed, it uses a potion on the player to heal
    • When “j” is pressed, it does a simple jab. There is a 10% chance of a critical hit.
    • When “p” is pressed, it does a power strike. There is a 15% chance of a critical hit.
    • When “b” is pressed, it does a block, which negates some damage from the monster.
    • When “d” is pressed, there is a small chance that you will completely dodge the attack from the monster.

    If you choose the wrong control, it means you hesitate and the monster still hits you.

    The Prize Room

    When you complete the specified amount of rooms for your artifact, you are taken to the prize room. It adds it to your inventory and then teleports you back to the Dungeon Master.

    Game Loop

    The game starts by asking the player for their username. Then they are greeted by the Gate Keeper and given their first quest. The game always makes the player go through a chest room then a monster room before starting the random room loop. Then once they go through enough rooms, they are taken to the Prize Room. Finally, they are asked to play again.

    Reflection

    This project was a fun thing to do. I learned how to use libraries I never really used before that much and it made the game so much more interesting. I made sure not to use AI because I like to use ChatGPT to do all the monotonous parts but I forced myself to write all the text myself, and it made the game that much better to make. It is a simple game but it still was fun to make.

    The main thing I learned from this project was the importance of planning before coding. I never really used flowcharts on any of my coding projects but using it genuinely made my job so much easier. I just went from part to part and it was so much faster. I moved so quickly.

    It was fun at the end to see how I had made a game where no two games are exactly the same all because of random chance. This is a very simple concept but I never really have used it like this.

    AI Transcripts:

    https://chatgpt.com/share/68d99155-4e8c-8004-ba9d-9a1ecfc7e132

    https://chatgpt.com/share/68d991c0-f690-8004-8e54-8ec11f457181

  • Still In Development!

    Still In Development!

    I haven’t posted anything yet!