Category: Uncategorized

  • CAD Project – Building a Miniature Rowing Boat in onShape

    picture of the final product

    Introduction:

    In this project, I wanted to design a miniature of a rowing scull using Onshape. The goal of this assignment was to apply fundamental CAD skills like sketching, extruding, and assembling to a real world object. Rowing is a sport that requires precision, balance and symmetry, and I wanted to capture that same spirit in my CAD model.

    I chose to replicate a rowing scull because I really enjoy doing the sport and it has been a major part of my life. Where I’ve been rowing for more than five years now and always admired the design of these boats. Additionally, I’ve always wanted to 3D print a model boat to display it on my desk, and this project felt like the perfect chance to turn that into a reality.

    Sketching 2D Design

    I began the design by first creating a part studio for the hull of the boat. Then I sketched the cross sections, also called stations (STA). And in boat designs, a station represents a specific slice along the boat’s length, and it’s almost like cutting the hull into thin vertical sections to see its internal shape at different points. Each cross-section shows the outline of the hull at that point, which helps to define the overall body curves from bow (the front of a rowing boat) to stern (the back of the boat).

    Using the planes, I drew ellipses from STA_0 (the bow) to STA_90 (the stern) to present the gradual transitions in width and height.

    cross section sketches

    Alongside the hull, I also made sketches for other parts like the rigger, oarlocks, and oars.

    sketch of the rigger

    Extrusion

    Next, I used the loft and extrude tools to create a smooth 3D solid object between the sketches. I then created another sketch for the cockpit opening on the top surface and used the extrude cut tool to remove material.

    hull after loft and extrude

    For other part studios, I also mainly used the extrusion tool to turn the sketch into a 3D object.

    rigger after extrude

    oarlock after extruding and applying fillets

    Assembly

    Once I’ve completed all individual parts in different studios, I created an assembly. I inserted the scull, rigger, oarlocks, and oars, then used fastened mates to secure all the parts to the boat. I also use the revolute mates when connecting the oarlock to the rigger to allow the oars to rotate around.

    I also played around with the animation for a while, I wasn’t able to find any ways to animate the oars on both sides together, so instead I’ve just showcased what it looks like animating one oar.

    Mechanical Drawings

    After completing the assembly, I created a drawing to communicate my design. The drawing for the assembly included top, front, and isometric views.

    For other individual parts, I included views from different angles and measurements.

    Bill of materials (BOM)

    The BOM is quite straightforward, I just wanted to highlight on the choice of materials. For several parts I chose to use carbon fiber as it is lightweight, durable, and also because most boats in real life use this material to improve speed and balance.

    Conclusion

    I really enjoyed doing this assignment and create my own 3D model of a sculling boat. During the process, I definitely learned more about 3D designs and CAD skills.

    Thanks for reading!

  • Coding Assignment

    For my coding assignment, I’ve created an Akinator like guessing game in Python, where the computer tries to figure out the character the user is thinking of. The program I created uses
    AI to generate simple yes/no questions, and the user responds until the AI makes a guess.

    Below is the flowchart I made for my program:

    Flowchart

    Image URL (clearer version): https://i.imgur.com/ddYnl0R.png

    Source Code: https://replit.com/@michaelhu28/Python?v=1

    1. Variables

    history = ""      # stores past questions and answers
    game_over = False # tracks if the game has ended
    question_count = 0 # counts number of questions asked

    This is part of the variables I’ve defined to keep track of the game’s progress. The history is a. string which stores a log of the entire conversation. game_over is a boolean (meaning can be assigned True of False) that stores the status of the game. And question_count keeps a total of how many questions the AI has asked.

    2. Functions

    def get_user_answer():
      #Gets user input
      while True:
        answer = input("You: ").strip().lower()
        if answer in ["yes", "y","no","n","maybe","m","stop","quit","q"]:
          if answer in ["yes", "y"]:
            return "yes"
          elif answer in ["no", "n"]:
            return "no"
          elif answer in ["maybe", "m"]:
            return "maybe"
          elif answer in ["stop", "quit", "q"]:
            return "stop"
          else:
            print("Please answer with yes, no, maybe, or quit.")

    This function validates the user’s input. Instead of crashing or accepting a random input, this function keeps asking the user until they provide a valid answer. It also takes into account different forms of input (like “y” and “yes”) into consistent outputs for the AI.

    3. Conditional Statements:

    if ai_output["type"] == "guess":
        ask = input("Is this correct? (yes/no): ").strip().lower()
        if ask in ["yes", "y"]:
            print("Great! I guessed it right.")
            print(f"It took me {question_count} questions to guess it.")
            game_over = True
        else:
            print("Sorry, I couldn't guess it right. Let's try again.")
            history += f"\nAI: {ai_output}\nYou: no (incorrect guess)"
            question_count += 1

    This portion of the code checks if the AI is making a guess or asking a question. This is made possible by prompting the AI to respond in a JSON format. If the type of response is a guess and is correct, it ends the game with a success message.

    Example response format:

    { "type": "question", "message": "Is your person real, not fictional?", 
    
    "confidence": 0.01, 
    
    "state": { "q_count": 1, "top_candidates": ["Barack Obama","Harry Potter","Elvis Presley"], 
    
    "notes": "Starting with real vs fictional split for major info gain." } 
    }

    Prompt Engineering:

    I have explored with the prompt and the different models to let the AI guess correctly using the least amount of questions. (left is the new prompt, right is the old one)

    Pros and Cons of the New Prompt

    ProsCons
    Improves the accuracy of the response.A longer prompt would result in longer response times.
    Specifies the structure of the response, making it readable by the program.Generating structured JSON with all that information can increase the token load.

    Result:

    When thinking of the same character(Mr. Beast), by using the new prompt, the program is able to guess it correctly using less amount of questions (15 questions – 22 questions). The new prompt also shows a confidence score when asking the question.

    What I Learned

    • How to use flowcharting to plan my logic before coding.
    • How to connect Python with the OpenAI API and structure prompts.
    • How to use loops, conditionals, and functions to make code readable and organized.

    Future Improvements

    • Add a confidence score so the AI can explain how sure it is about a guess. (Added)
    • Save the transcript of each game to a file so I can analyze failures.
    • Build a version with GUI

    Update (Sep. 28):

    After receiving feedback that my original setup required a paid API and wasn’t directly runnable, I updated my project to use the Google Gemini API. This change allows anyone to clone the project and run the program for free without extra setup. To make the project accessible over time, I also recorded a short walk-through video demonstrating how the game works in action. This way, even if the API service changes or keys expire, readers can still clearly see the program’s functionality.

    Thanks for Reading my First Blog Post!

  • test

    test

    One response to “test”

    1. michaelh Avatar

    Leave a Reply

    Your email address will not be published. Required fields are marked *

  • Hello world!

    Welcome to User’s blog Sites. This is your first post. Edit or delete it, then start writing!