Author Archives: Mr. M

Complex Shape 1 with Arcs and Constraints

  1. Use the front plane and the make a 3 point arc centered at the origin 3 point arc
  2.  Picture:screenshot.1
  3.  Use the dimension tool   to set the radius to 20 mm : dimension the arc
  4. Resulting shape : screenshot.2
  5.  create 2 lines that are attached to the circle and that meet at a point outside the circle. Dimensions don’t matter, yet, for these. Your document should look similar to (does not have to be exact
  6. : two secant lines
  7.  Use the Tangent tool to make both lines tangent . You must select both the circle and the line as shown below:2 tangents
  8.   Create a construction line from the end points of the arc:

    construction line-diameter

    Click to enlarge image

  9. Create a Rectangle, as shown in the video below. Watch the end carefully for how to make the points coincident. Your interconnected shape should move as shown below:rectnagle w coincident points
  10.  Use the Dimension tool to make sure that the height of the rect is 65 MM :

    Click to enlarge image

    Click to enlarge image

  11. Add a midpoint to the bottom of the rectangle:Click to enlarge
  12. Make a Circle centered at that midpointbottom center
  13. Dimension the bottom circle so that its diameter is 35 : dimension bottom circle
  14.  As you can see only the top tangent line is blue. So that’s the last item to dimension! Dimension it to 42 :
  15. top is 42
  16. Use the trim tool to remove the top half of the circle and its diameter line:trim interior
  17. Now your turn. In the same document. Create a complex separate shape. This shape should include a minimum of 5 simple shapes. 1 of the shapes must be an arc or a semicircle. All of the shapes must be dimensioned.

Constraints Additional Practice

 

Step 1)  Create a new sketch on the front plane. There should only be 1 sketch that you use

Step 2)  Create a circle and then use the “coincident ” button to center it on the origin by clicking on the origin, the center of the circle :

center circle with coincident

 

Step 3) make its radius 15 MM by using the dimension tool

dimension circle with button

Here’s what your document should now look like :

15 mm circle

Step 4)  Do the same thing with a second circle . Make its radius 30

Picture: 30 mm circle

Step 5) Make a line that touches the circle, anywhere. Like the picture below:

secant line

 

 

Step 5) Find the “tangent line”  constraint (this might be a dropdown)tangent line

 

Step 6) Here’s how you create a tangent line.

Click the circle , click the line you made, then press “tangent line ”

 

how to make tangent line

Step 7)  Make a construction line from the tangent line to the bottom

construction line

 

Step  8) Make a second tangent line as shown:

tangent line 2

 

Step 8) Dimension both tangent lines so that they are 60 MM each

 

Step 9) Add a second shape that is dimensioned.

DDP Assignments

How To’s

 

Unit 1, Onshape

Tutorial Tips

  1. Advanced Parts Tips 1
  2. Import image to onShape

4th Quarter Project [24-25]

Examples

Objective: To create a complex, industry level, project that builds off the skills we learned this year.  There is some flexibility here in that you can diverge some from pure web development. You must learn at least one new technology  to create a unique deliverable.

Your grade will be based on the level of complexity of your final project. I have listed some examples of technologies to learn and rated their general complexity. Ultimately, complexity will be evaluated by me and you are welcome to ask for feedback on where the complexity of your project will land you.

Note: There are huge numbers of technologies, frameworks etc, and I  am not familiar with many of the ones below.  The purpose here is for you to learn something, yourself, as web developers are often forced to do,  in the real world.  If you think you will need help, I suggest going with Phaser because  many students will do it and you can help each other . I have limited knowledge of Phaser. I can help with general debugging and general strategies.

Some Prior Games : https://mrmonline.org/supa-2019-games/

 

Some Example of New Technologies

Front End Frameworks
  • Phaser ( The most popular 4th quarter project topic is to create phaser games housed in a bootstrap based website). There is a great range in complexity using Phaser. See bottom of page for some good phaser resources.
  • Vue
Back End Frameworks for PHP

Example Projects, probable complexity and grade.

The table below lists  example technologies and provides a likely grade for its general description and complexity level. If something is classified as an “add-on,” then it is a way to increase complexity but should .

Often the grades are a “range” because it depends on what, ultimately your project does. Take “vue” for instance. This is a very popular, very modern javascript framework so it can be quite complex, but ultimately it depends on what your program actually does that will determine the final grade.

Technology  Example/ Complexity overview Complexity lvl Grade
Phaser (meh) Edits one of the pre-built games on phaser.io, nothing much new very low C-
Phaser (moderate) Creates one new game, but it is relatively simple (asteroids) and submits 1 page website that uses bootstrap Moderate C+
Phaser (good) Creates completely new complex game (maybe uses physics or other unique coding) moderate-high B+/ A
Node.js/Gulp   Learns how to use nodejs and employs Gulp to improve workflow Moderate add on
 Remote git Learns how to push and pull from remote git repo on github low add-on
 Vue Learns how to use the vue.js framework for javascript development high B /A-
Foundation Learn a bootstrap alternative and create several web pages moderately low C+
Angular Creates a multi page website with the angular .js framework high B/A
Mathjax Learns how to integrate the Mathjax math library for rendering professional looking mathematics low add-on
Vim Consistently edits with Vim . I will quiz you on how to use VIM and I will expect to see you editing with VIM during class moderate add on

List of other utilities and libraries to use:

Notes: these can be combined to add complexity and professionalism. For instance, you can create a multipage website based on Vue and some of the pages can house phaser games that you create. This has the potential of an A+, depending on the Phaser GAME(S).

Not comfortable with Programming? Here is a multi technology example that will get a B-:

This is an example that will get people who are not very comfortable with programming into the “B” range: Learn how to use Foundation, or another bootstrap alternative, and also how to integrate Mathjax to display math equations. You can create a multi page math website full of equations. You could add using remote git or Gulp to get the grade up even a bit more.

Javascript framework comparisons : https://www.codeinwp.com/blog/angular-vs-vue-vs-react/

Other resources

https://emanueleferonato.com/  – Great Javascript game dev site

  • Simple phaser game tutorial using just javascript (no typescript)   here 

https://photonstorm.com/ – same


Sample Proposal

New Technology : Phaser (main) plus using Vim as add-on

Rough Overview

I will be using Phaser.io to develop 2 original complex games, 1 of which will involve phaser physics. Both games will be housed in a simple bootstrap website and will use php and mysql to allow for

  • user registration
  • user login
  • high scores tables to be stored in a database

I will also be actively developing using the Vim editor (to get some extra points)

Deliverables :

2 full games that can be started, paused, re-started, replayed and allow for the user to save his/her scores to a website that they log into. The site will have a mobile friendly design including for game play.

 


 

 

 

Prior Version

SUPA Web 24-25

Last Web class

imageBB

Template Files

Links to Images we use

Bootstrap

Presentations: https://mrmonline.org/bootstrap-presentation/

Bootstrap Themes : https://bootswatch.com/4/

 

Rules Conventions for Variable Names

Employ the rules/conventions below. -1 point  for violating these standards

Variable Name Rules

  • must begin with a letter or $ (Unless you’re using a language like PHP it should be a letter)

Variable Name Conventions

  • descriptive  ( moo  is not a good variable name to represent the number of days )
  • uses camelcase (unless it’s a static variable etc..)
  • camelcase

^^image from https://khalilstemmler.com/blogs/camel-case-snake-case-pascal-case/

Jslider Extra Credit Jeroo Map

 
Description: Pick all of the flowers in the map below  using just 1 while loop
  • However, the loop does not need to end. Meaning after all the flowers are picked it’s ok for the Jeroo to continue to go through the loop and move around forever.
  • However, if you can do it with just 1 while loop  (you can get extra credit). See how Matt k did it
  • Map location: maps-student\mazes\mazes-2\jslider-map.jev
  • Extra Credit amounts :
    • Used 50 lines or fewer = 4 points extra credit
      • Tip : To try to get this few lines of code you will probably need to avoid a custom method for interior of lake.
    • Used  60 lines or fewer   = 3 points EC (that’s a lot)
    • Used  70 lines or fewer   = 2 points EC (that’s a lot)
    • Used 80 lines or fewer = 1 points EC
Current record for fewest lines : 32 lines of code
The Kukai Method
jslider-map-kukai

The Sam Smith Method
uber-map-sam-s

The Hamza Method
uber-map-hamza-solutio

Cody Smith Method

crop-image

Christian’s Bismarck  Solution

bismark

PlayList Java Project 2022-23

A Note on plagiarism

If you hand in work that you can not  explain, it is considered plagiarism.   Let’s not go there please. Remember- we follows Syracuse’s academic guidelines . If you use someone else’s work for a portion of the assignment, you will get a zero for the entire assignment. Additionally, if a person in the class gives you the code, that other person also gets a zero.

Project Overview:

A PlayList project will be based on 3 Classes

  • Artist
  • Song
  • PlayList

The Artist  class will store core information about an artist.

The Song  class will store basic information about a song.

The PlayList  class will manage a list of artists and their ratings.

Tester files:

  • Artist and Song tester file SongArtistTester.v0  – run this after you have completed the Song and Artist classes and before PlayList. This way, you’ll know that you have correctly done the the foundation classes before moving onto PlayList
  • PlayList tester File :  PlayListTesterv4
  • At the very bottom, are 2 challenging extra credit methods. If you decide to do either one, you must meet with me to go over the code you submitted.
  • Additional grading penalties for the following issues :

Penalties  :

  • does not compile : -5
  • instance variables not explicitly declared private  : -1
  • not following strict OOP conventions for initializing variables . Read more here.
  • lack of code reuse   (-1 per occurrence)
  • non descriptive variable name including loop index counters etc   : ( -1 per occurrence)
  • not using camelcase for variable names (-1)
  • int division -1
  • failure to name a method or class exactly as indicted (-1 per occurrence)  – which is a real thing . You will generally work in teams and be expected to use exact spelling/capitalization.

The 3 classes in Detail 

Artist

  • Constructor(s) :

    • public Artist(String name)
  • Instance Variables
    • private String artistName ;
    • private ArrayList<Song>  songs  ; – an array storing the songs of this artist
  • Methods
    • public void addSong(Song song)  .  Add the song to the arraylist.
    • public String toString()
    • public boolean equals(Artist other)  //returns  true  if artistName  is the same as other’s artistName 
    • public ArrayList<Song> getSongs()
    • public String getName()

Example of instantiating an Artist object and calling one of its methods:


Song

  • Constructor(s):
    • public Song( Artist _artist, String _name)
  • Instance Variables
    • private Artist artist
    • private String name
  • Methods
    • public String getName()
    • public Artist getArtist()
    • public boolean equals(Song other) //returns  true  if both the song objects have the same artist and name.
    • public String toString()

Example of instantiating a Song object :


Before you do the PlayList class, run the Artist/ Song tester (see top ^^)


PlayList

Read this to make sure you’re doing variables correctly.

 

  • Static Variable
    • public static final int MAX_NUMBER_SONGS = 12 ;

  • Instance Variables

    • private String listName  ; This is the ‘name’ of your playList
    • private ArrayList<Song> songs  ;
    • private ArrayList<Integer> stars   ;//how many stars each song has
    • Note: songs and stars are parallel ArrayLists
  • Constructor
    • public PlayList(String name)  : There should be only 1 constructor that takes a parameter representing the name of the playList. Read this 
  • Accessor Methods
    • public double averageRating()  // returns the average star rating for the  list
    • public ArrayList<Song> getSongs()  // returns the songs
    • public double averageRating(Artist artist)  // returns the mean star rating associated with artist
    • public Song[] getSongs(Artist artist)  // returns an array populated by the songs of parameter artist
    • public ArrayList<Artist> getArtist(String songName)  // returns an ArrayList of all Artists associated with the String songName  (This could be multiple musicians. Cover songs etc..)
    • private int indexOf(Song someSong)  // code reuse, hint hint. ie This is the method that you should use elsewhere any time you need to find an index.
    • public String toString()  //returns an appropriate String representation of the PlayList  . Here is an example of the toString() value for a  PlayList I created.
    • public String getName()  // @returns the listName  of the PlayList
    • public ArrayList<Integer> getStars()  //returns the  stars  ArrayList

    Mutator Methods

    • public void swap(Song song1 ,  Song song2, )  // switches positions of these two (maintain parallelism!)
    • public boolean add(Song _song , int _stars)
      //adds data if number of song is less than MAX_NUMBER_SONGS
    • public void removeSong(Song song)  /removes all occurrences of  song  . There could be multiple instances of song. Maybe someone really likes a particular song and has it several times in one list. (Hint : Do not loop forwards)
    • public void removeArtist(Artist artist )  //removes all elements associated with  artist
    • public void removeLowStars(int cutOff)  //removes all elements associated with a star rating less than or equal to  cutOff

 


The 2  method’s below are extra credit. If you figure out how to do them, you must also meet with me after school about the methods. To receive the extra credit, be prepared for a mini-quiz on how they work . You will need to do some research to figure out how to do them.  Be prepared for me to ask about your solution and how changing certain parts of your code would affect your solution.

  • **  public PlayList sortByRating()  //this returns a rearranged playlist so that the 5 starred elements are the first group in the list, 4 stars second …1 stars, last
    • To do this , you should use a sorting algorithm. I suggest, Selection Sort (link). As this both intuitive and on the AP.
  • **  public PlayList shuffle()/ /this returns a new PlayList in which all of the songs have been reordered randomly

When you’re done this, begin exploring different sorting algorithms with this online sorting detective :

https://labs.penjee.com/sort-detective/

sort-detective

 

Prior version