Skip to content

2. Computer Aided design

This week set a strong foundation for my final project and gave me the momentum I needed.

What’s expected this week?

To try at least 2 2D software, and 2 3D software.

What is parametric design?

Parametric design is an approach in engineering and CAD where a model is built using parameters and constraints rather than fixed dimensions. This allows for automatic updates and optimization when values are changed. I have taken parametric design to the next level while working on my final project. Which I’ll showcase later on in the Fusion section.

Raster vs Vector

Raster images are made up of pixels, meaning they can lose quality when resized (pixelation). They are best for photographs, digital paintings, and textures and come in formats like JPG, PNG, and BMP.

Vector images, on the other hand, are made using mathematical paths (lines, curves, and shapes), so they can be scaled infinitely without losing quality. They are ideal for logos, icons, CAD models, and technical drawings, with formats like SVG, AI, DXF, and DWG.

Using cuttle

Cuttle is a web-based 2D design software tailored for laser cutting and vinyl cutting. It focuses on parametric design, allowing users to create dynamic, scalable, and customizable designs with live variables and constraints—similar to Fusion 360 but for 2D applications.

Using Inkscape

Components of your design you’ll want to maintain

  • Symmetry
  • Emphasis (by color or by size)
  • Repetition
  • Movement
  • Proportion
  • Contrast (highlighting the difference by shape color or scale)
  • Rhythm
  • Patterns
  • Unity
  • Color (you can get into color theory as well, and this is used in finishing like painting)

BlocksCAD

This helps make 3D designs by building blocks (coding blocks).

Fusion

This is where my main focus was this week. I wanted to design something similar to this, which would basically act like a part that sits on the keyed shaft of the motor, and on it plugs the spool. I started by making a sketch of the parts I want to design that will be placed on the motor’s shaft, that the spool will be attached to. The sketch involved calculations that ensure that the dimensions of the part we’re making, change accordingly with the dimensions of the available bolt (such as the bolt’s length, its head’s thickness, and the diameter of the spool’s hole). So I generated a MATLAB code that satisfies the conditions, and gives us the dimensions of the part for each bolt.

MATLAB code
% MATLAB Code for Optimizing Bolt Length and Minimizing Coupling Size

% Define inputs
d1 = input('Enter the inner bolt diameter (d1, e.g., for M4 enter 4): ');
k = input('Enter the bolt head length (k): ');
spool_hole_radius = input('Enter the spool hole radius (at least 8.25 mm): ');

% Maximizing bolt length while keeping r minimal
table_data = []; % Store values for a table output

tolerance = 0.1; % Allow minor deviations for numerical precision

% Start with initial r
r = spool_hole_radius + d1 + 0.5;

for C2 = 5:1:20  % Iterate through integer values of C2 up to 20

    % Ensure r is large enough by checking h1 condition
    while true
        % Compute h2 based on C2 formula
        if (r^2 - (C2 / 2)^2) < 0  % Skip invalid cases
            break;
        end
        h2 = sqrt(r^2 - (C2 / 2)^2); % Solve for h2
        h1 = h2 - d1; % Compute h1

        % If h1 is too small, increase r
        if h1 <= spool_hole_radius
            r = r + 0.1;
        else
            break;
        end
    end

    % Ensure valid range
    if h1 > spool_hole_radius && h2 < r
        % Store values in the table
        table_data = [table_data; C2, 2*r, h1, h2];
    end
end

% Display results in a formatted table
fprintf('\n%-10s %-15s %-10s %-10s\n', 'C2 (mm)', 'Coupling Diameter (mm)', 'h1 (mm)', 'h2 (mm)');
fprintf('%s\n', repmat('-', 1, 50));
for i = 1:size(table_data, 1)
    fprintf('%-10.1f %-15.2f %-10.2f %-10.2f\n', table_data(i,1), table_data(i,2), table_data(i,3), table_data(i,4));
end

% Plot Coupling Diameter vs h1 with C2 Labels
figure;
plot(table_data(:,2), table_data(:,3), 'bo-', 'MarkerFaceColor', 'b');
for i = 1:size(table_data, 1)
    text(table_data(i,2), table_data(i,3), sprintf('%d', table_data(i,1)), 'FontSize', 10, 'HorizontalAlignment', 'right', 'VerticalAlignment', 'bottom');
end
xlabel('Coupling Diameter (mm)');
ylabel('h1 (mm)');
title('Coupling Diameter vs h1 with C2 Labels');
grid on;

% Plot Coupling Diameter vs C2 with h1 and h2 Labels
figure;
plot(table_data(:,2), table_data(:,1), 'go-', 'MarkerFaceColor', 'g');
for i = 1:size(table_data, 1)
    text(table_data(i,2), table_data(i,1), sprintf('h1=%.2f\nh2=%.2f', table_data(i,3), table_data(i,4)), 'FontSize', 9, 'HorizontalAlignment', 'right', 'VerticalAlignment', 'bottom');
end
xlabel('Coupling Diameter (mm)');
ylabel('C2 (Bolt Length) (mm)');
title('Coupling Diameter vs C2 with h1, h2 Labels');
grid on;

% Compute percentage increase relative to C2=7mm
reference_index = find(table_data(:,1) == 7, 1);
if ~isempty(reference_index)
    reference_diameter = table_data(reference_index, 2);
    percentage_increase_diameter = ((table_data(:,2) - reference_diameter) / reference_diameter) * 100;
    percentage_increase_C2 = ((table_data(:,1) - 7) / 7) * 100;
    ratio_increase = percentage_increase_C2 ./ percentage_increase_diameter;

    % Display comparison table
    fprintf('\n%-10s %-15s %-20s %-20s %-20s\n', 'C2 (mm)', 'Coupling Diameter (mm)', 'Increase in Coupling Diameter (%)', 'Increase in Bolt Length (%)', 'Bolt Length Increase / Coupling Diameter Increase');
    fprintf('%s\n', repmat('-', 1, 90));
    for i = 1:size(table_data, 1)
        if table_data(i,1) >= 7
            fprintf('%-10.1f %-15.2f %-20.2f %-20.2f %-20.2f\n', table_data(i,1), table_data(i,2), percentage_increase_diameter(i), percentage_increase_C2(i), ratio_increase(i));
        end
    end
end
What the code asks you to input

Enter the inner bolt diameter Enter the bolt head length Enter the spool hole radius

Code result

Changing parameters in Fusion based on most optimal bolt

Making the shape with Fusion 360

Result


Last update: March 26, 2025