Implement script to create a planetary gearBRL-CAD
Status: ClosedTime to complete: 100 hrs Mentors: Kesha Shah, HarmanpreetTags: c, planetary, code, gear, c++

This is a follow-on task to https://www.google-melange.com/gci/task/view/google/gci2014/6464160023969792 to get credit for the scripting effort.

Submit your script(s) with comments embedded that explain the logic. Also provide simple instructions on how to use/run the script, any tools or libraries required, and any limits one might encounter.

References:
  • https://www.google-melange.com/gci/task/view/google/gci2014/6464160023969792
Uploaded Work
File name/URLFile sizeDate submitted
circle_skript.py1.9 KBJanuary 08 2015 09:44 UTC
tooths_sсript_new.py1.1 KBJanuary 08 2015 11:17 UTC
work script.png423.0 KBJanuary 08 2015 11:23 UTC
Gear.zip1.5 KBJanuary 10 2015 08:07 UTC
Comments
Raptoron January 8 2015 09:40 UTCTask Claimed

I would like to work on this task.

Popescu Andrei on January 8 2015 09:41 UTCTask Assigned

This task has been assigned to Raptor. You have 100 hours to complete this task, good luck!

Raptoron January 8 2015 11:20 UTCUsing a script

The first version of the script was flawed because it was necessary to enter data in mged. The second version does everything itself ) I run a script on a linux system :


chmod u+x script path


./skript


Should be python3.4 interpreter in the standard way . On windows , simply run the script with the mouse , it must be started.


Example of the work script can be seen in the picture

Raptoron January 8 2015 11:23 UTCReady for review

The work on this task is ready to be reviewed.

Raptoron January 8 2015 11:25 UTC

If youreplace thewindowsin the scriptpathon the respective

Sean on January 8 2015 15:56 UTCTask Needs More Work

One of the mentors has sent this task back for more work. Talk to the mentor(s) assigned to this task to satisfy the requirements needed to complete this task, submit your work again and mark the task as complete once you re-submit your work.

Sean on January 8 2015 15:57 UTCcomments

Raptor, this looks great, but you left off adding some comments to explain what the logic is doing and why (and summary / details that might not be obvious with the logic itself).


 

Raptoron January 8 2015 18:17 UTCLogic my script

Webase radius, enter internal or externalradius: Outer ismore than usual,the innersmallertheradius forservingtop.Deltatheseradiiwillbe the length ofthe tooth(the median of the triangle).

Then,the number of teeth, dividing 360by the number ofdegreeswe findrequired foreach tooth, half of this degreeisprojectingtooth.

Loopingprocess ofaddingdegreeswe getthe coordinates((sin * angle) * R =x, (cos * angle) * P= y, Z -set)

Createarb6.


 


 

Raptoron January 8 2015 18:18 UTC


What is yournickname inirc,andwhen you get there?

Raptoron January 8 2015 18:34 UTC

sin_angle and cos_angle not *

Raptoron January 9 2015 16:24 UTCReady for review

The work on this task is ready to be reviewed.

Sean on January 10 2015 02:53 UTCTask Needs More Work

One of the mentors has sent this task back for more work. Talk to the mentor(s) assigned to this task to satisfy the requirements needed to complete this task, submit your work again and mark the task as complete once you re-submit your work.

Sean on January 10 2015 02:55 UTC*code* comments :)

Hehe, Raptor, I meant comments *in* the code.  Code // comments.  So when someone reads these scripts in 5 years, they won't have to decipher every line to guess what your intentions were and what it's actually doing.  Upload new versions of circle_skript.py and tooths_script_new.py that have comments embedded.  Make sense?

Raptoron January 10 2015 08:07 UTCReady for review

The work on this task is ready to be reviewed.

Raptoron January 10 2015 22:24 UTCOther work

Also I have done with a script 
https://www.google-melange.com/gci/task/view/google/gci2014/5292150220652544
https://www.google-melange.com/gci/task/view/google/gci2014/5297983323111424

Sean on January 11 2015 08:17 UTCmissing summary

Raptor, the comments you added to tooth_script.py were vary vague and in many instances merely repeat what the code already says.  Comments should say what the code does NOT say, like summarizing that you're getting inputs from the user in the first half and iterating around in circles  like an hour glass in the for r in range loop.


Adding comments is about summarizing and explaining why .. NOT what. The comments you added are almost entirely stating what.


Please try one more time.  I suggest not putting comments at the end of lines.  Put them on lines by themselves before sets of lines that you will talk about.  For example:


# read specifications from the user that will define the shape of


# this gear.  the resulting shape looks sort of like a tooth gear.


for r in range(n): ...


 

Sean on January 11 2015 08:19 UTChere's an example

Here's a better example of good commenting.  Note all of the # lines throughout.  They say what the code does not.  Summarizing and explaining why.


https://sourceforge.net/p/brlcad/code/HEAD/tree/brlcad/trunk/bench/run.sh


 

Sean on January 11 2015 08:20 UTCTask Closed

Congratulations, this task has been completed successfully.

Sean on January 11 2015 08:21 UTCoh well

accidentally closed.  *sigh*  If you're inclined to add proper comments, please e-mail them to contest at brlcad dot org.

Raptoron January 11 2015 11:50 UTC

Thank you, I'll post) will spread in the irc chat or mail

Raptoron January 11 2015 12:12 UTC

I redid the comments in the script - https://mega.co.nz/#!GAUH1QZD!wvanPjtAmKpfyxw4CghiOojy72Y2L9-b1jqYw8vm7k