程序代写案例-MENGM1411

欢迎使用51辅导,51作业君孵化低价透明的学长辅导平台,服务保持优质,平均费用压低50%以上! 51fudao.top
MENGM1411: Computer Based Modelling
5. Parametric design project
1
Andrew Harrison
[email protected]
Room 2.12 Queens Buil
ding
Parametric design and interface with a
rapid prototype machine
◼ Parametric design is the generation of geometry from the
definition of:
a group of initial parameters
 the relations between the parameters
◼ This hierarchy of mathematical and geometric relations will
allow you to generate a certain design
◼ Aims of this project
Develop an ‘interesting’ geometric form of your choosing
Generate an .stl file that contains appropriate details of the design (stl
file may be used to interface with rapid prototype machine)
2
Example: Desk fan (M. Alaleeli, L. Chen, 2016)
3
4Example: Wheel rim(T. Streuli, O. Schiffmann, 2019)
Project tasks
◼ Develop a simple algorithm that receives input and displays
the design on screen
A Graphically User Interface (GUI) is the preferred method for doing
this
◼ Develop or modify (as appropriate) a function that writes an
‘.stl’ output file
There are currently functions available in MATLAB
◼ https://uk.mathworks.com/matlabcentral/fileexchange/20922-stlwrite-filename-
-varargin-
◼ https://uk.mathworks.com/matlabcentral/fileexchange/36770-stlwrite-write-
binary-or-ascii-stl-file
◼ Extend the complexity of your parametric design object
5
Assessment
◼ Final project (100%) – Parametric design
 Submission of a zip file containing all your MATLAB code
 Submission of your report, pdf file (maximum 7 sides) on Blackboard -
Deadline: 07/05/21 by 11:59a.m. Assessors will not consider and assess
anything you wrote above the page limit
 All submissions are checked against plagiarism!
 Viva examination (10 min) – 13-14/05/21
6
Marking criteria
7
◼ Code (60%)
 Performance
◼ Does the program run?
◼ Are the results correct?
◼ Does the program complete all the required aspects of the project?
◼ ‘User Friendliness’ (GUI)
◼ Brevity / Speed of execution
◼ Suggestions for improvement and development of the project
 Aesthetics
◼ Presentation of results / use of graphics as appropriate
◼ Program structure – use of indentation, functions…
◼ Sensible variable names
◼ Report (40%)
 Follow the report template available on Blackboard
◼ Note: Your final mark will depend on the level of complexity of the object you choose
to design as well as the functionality of your code
A simple example of parametric
design…
8
9−15
−10
−5
0
−15
−10
−5
0
Centre hole radius
Collar width
Number of teeth
Collar height
Main outer radius
Gear thickness
Teeth length
Example code outline
% Input parametric data, .e.g.
number_teeth = 30; centre_hole_radius = 1; collar_width = 1;
main_outer_radius = 5; collar_height =0.5; teeth_length = 1;
gear_thickness = 1;
% calculate dependencies: e.g.
collar_radius = centre_hole_radius + collar_width;
teeth_outer_radius = main_outer_radius + teeth_length;
% Create an object that can be manipulated into a gear
% Hint: use the in-built cylinder function to create (x,y,z) points
% Output
% 1) Plot the gear in 3D
% 2) Save the geometry data to a .stl file: hint use stlwrite e.g.
Where to start?
◼ Start with the preliminary exercise on Blackboard
◼ Understand how to create
 A gear (pdf files available on Blackboard)
 Multiple gears
◼ Develop from here in incremental stages
◼ Guidelines
 Planning: divide the project into several smaller manageable task (e.g. functions), each of
which should not contain more than around 50 lines
 Writing: Adopt a ‘top down’ approach – write the main body first, then the detailed tasks.
Use meaningful variable names.
 Debugging: Consult the staff as well as the online help (values of global variables can be
checked using the workspace browser, line-by-line step) It is important that you can
demonstrate that your software generates correct results
 Improving: use the Profiler tool to identify the lines in your code that take the most time to
execute and then look for ways to speed them up. Where possible eliminate for loops – try
instead to operate on an entire array in one command (vectorisation)
11
Today 11-12/03/2021
12
◼ By now, you should have:
Completed the preliminary exercise (how to create a gear) – Solution
available on Blackboard soon
◼ Now:
Complete the tutorial about how to create a GUI using AppDesigner

欢迎咨询51作业君
51作业君

Email:51zuoyejun

@gmail.com

添加客服微信: abby12468