Skip to content

3DprintFIT/B252HW-Assignment

Repository files navigation

Rally Switch


Česky

Vaším úkolem je namodelovat „Rally Switch" pro ovládání roadbooku na motocyklové závody.

Na obrázku vidíte, jak taková věc vypadá ve skutečnosti.

Ilustrace

Budete modelovat zjednodušenou variantu.

Náhled celku

Odevzdání a termíny

Založte repozitář: https://classroom.github.com/a/zRvNuyO1

Deadline odevzdání je 17.5.2026 23:59 CEST (= konec výuky LS). Vypracovaný úkol nahrajte do repozitáře vytvořeného na odkaze výše. Nikam jinam jej neposílejte, jako odevzdání se počítá to, co bude ve vašem repozitáři (ve výchozí větvi (většinou main)) v momentu deadlinu.

Pokud máte jakékoliv dotazy, či naleznete chyby, napište je prosím do Issues v tomto repozitáři.

Po pushnutí commitu do vašeho repozitáře proběhne sada testů. Testy vyžadují optickou kontrolu. Testy 20 a 21 (velmi velké a malé hodnoty) mají v hodnocení dvojitou váhu, ostatní testy jsou rovnocenné.

Rozhraní

Váš model implementujte jako modul v OpenSCADU s tímto rozhraním:

module rally_switch(
    buttons=[3,3],
    bar_diameter=28,
    bottom_base_height=3,
    button_bottom_access=12,
    button_diameter=10,
    button_edge_spacing=[8,13],
    button_lock_rim_height=2,
    button_spacing=[5,5],
    cut=1,
    joystick_diameter=15,
    joystick_wall_thickness=3,
    mounting_screw_diameter=4,
    mounting_screw_head_depth=5,
    mounting_screw_head_diameter=6,
    switch_cable_hole_depth=3,
    switch_cable_hole_diameter=16,
    switch_cable_hole_width=6,
    switch_height=15,
    switch_screw_depth=4,
    switch_screw_diameter=3,
    switch_screw_distance_from_edge=3,
    switch_screw_distance_from_top=10,
    switch_screw_spacing=20,
    top_base_height=5,
    show_bottom=true,
    show_top=true,
    )
{
    // ...
}

Smíte (je to dokonce žádoucí) vytvářet další pomocné moduly. Smíte vytvářet další pomocné soubory (ale není to potřeba).

Váš modul musí jít použít následujícím způsobem z jiného souboru ve vašem kořenovém adresáři vašeho repozitáře:

use <rally_switch.scad>

rally_switch();

Výchozí hodnoty argumentů musí zůstat zachovány dle tohoto rozhraní! Naše testy budou jednotlivé argumenty nastavovat, ale budou předpokládat stejné výchozí hodnoty!

Parametry

Vámi namodelovaný model se bude skládat ze dvou částí: bottom a top. Pomocí argumentu show_bottom (respektive show_top) lze zobrazení těchto částí vypnout (respektive zapnout). Nezobrazení jedné části nemá vliv na pozici části zobrazené.

Parametr buttons určuje počet děr na tlačítka (část top) ve směru os X a Y. Další dvousložkové parametry se chovají stejně (první složka udává rozměr po ose X, druhá po ose Y).

Všechny další parametry udávají rozměry jednotlivých součástí dle přiložených schémat.

Umístění v souřadném systému

Pro automatické testy je naprosto zásadní, aby váš model byl umístěn na správném místě. Modely umístěné špatně budou vyhodnoceny jako nesprávné. Věnujte proto umístění modelu zvýšenou pozornost.

Model leží v nezáporných částech os X a Y počínaje v nulách.

Model leží středem předělu mezi částmi bottom a top na rovině XY (tedy na Z=0).

XYZ

Horní díl (část top)

Náhled top

Schéma top

Schémata lze zvětšit. V repozitáři jsou i vektorové varianty.

Spodní díl (část bottom)

Část bottom

Celek

Schéma celku

Na obrázku si všiměte úchytu na joystik a jeho zarovnání na předposlední (počítáno od Z=0) díru na tlačítko. Situaci, kdy je holes.x méně než 2, nemusíte řešit.

Nefunkční požadavky

  • Manipulace s $f* hodnotami je zakázána
  • Je zakázáno použít konstrukci minkowski() (ve 3D i ve 2D prosotoru)
  • Nelze použít operátor ^
  • Není doporučováno používat rekurzi, ani to k vyřešení úkolu není zapotřebí
  • Využití externích knihoven (včetně knihovny MCAD) je zakázáno
  • Pokud je něco zakázáno, vede použití k tomu, že neprojdou testy a dostáváte 0 bodů
  • Váš kód musí splňovat určitou kvalitu (tato část tvoří 5 bodů z celkových 30 možných)
    • Opakování v kódu je špatně, vždy použijte moduly a cykly
    • Bulharské konstanty musí být doplněny o vysvětlující komentář
    • Dodržte logickou úroveň odsazení

English

Your task is to model a "Rally Switch" for controlling a roadbook in motorcycle races.

The image below shows what such a device looks like in reality.

Illustration

You will be modeling a simplified version.

Overview

Submission and Deadlines

Create a repository: https://classroom.github.com/a/zRvNuyO1

The submission deadline is 17.5.2026 23:59 CEST (= end of the summer semester). Upload your completed assignment to the repository created at the link above. Do not submit it anywhere else — the submission is whatever is in your repository (on the default branch (usually main)) at the time of the deadline.

If you have any questions or find errors, please post them in the Issues of this repository.

After pushing a commit to your repository, a set of tests will run. The tests require visual inspection. Tests 20 and 21 (very large and small values) have double weight in grading; all other tests are equal.

Interface

Implement your model as a module in OpenSCAD with this interface:

module rally_switch(
    buttons=[3,3],
    bar_diameter=28,
    bottom_base_height=3,
    button_bottom_access=12,
    button_diameter=10,
    button_edge_spacing=[8,13],
    button_lock_rim_height=2,
    button_spacing=[5,5],
    cut=1,
    joystick_diameter=15,
    joystick_wall_thickness=3,
    mounting_screw_diameter=4,
    mounting_screw_head_depth=5,
    mounting_screw_head_diameter=6,
    switch_cable_hole_depth=3,
    switch_cable_hole_diameter=16,
    switch_cable_hole_width=6,
    switch_height=15,
    switch_screw_depth=4,
    switch_screw_diameter=3,
    switch_screw_distance_from_edge=3,
    switch_screw_distance_from_top=10,
    switch_screw_spacing=20,
    top_base_height=5,
    show_bottom=true,
    show_top=true,
    )
{
    // ...
}

You are allowed (and even encouraged) to create additional helper modules. You may create additional helper files (but it is not necessary).

Your module must be usable in the following way from another file in the root directory of your repository:

use <rally_switch.scad>

rally_switch();

The default argument values must remain as specified in this interface! Our tests will set individual arguments, but will assume the same default values!

Parameters

Your model will consist of two parts: bottom and top. Using the show_bottom (or show_top) argument, you can toggle the display of these parts on or off. Hiding one part does not affect the position of the displayed part.

The buttons parameter specifies the number of button holes (in the top part) along the X and Y axes. Other two-component parameters behave the same way (the first component specifies the dimension along the X axis, the second along the Y axis).

All other parameters specify the dimensions of individual components according to the attached diagrams.

Coordinate System Placement

For automated tests, it is absolutely essential that your model is placed in the correct position. Incorrectly placed models will be evaluated as incorrect. Therefore, pay close attention to the placement of your model.

The model lies in the non-negative parts of the X and Y axes, starting from zero.

The model is centered at the boundary between the bottom and top parts on the XY plane (i.e., at Z=0).

XYZ

Top Part (top)

Top preview

Top diagram

Diagrams can be enlarged. Vector versions are also available in the repository.

Bottom Part (bottom)

Bottom part

Assembly

Assembly diagram

In the image, note the joystick mount and its alignment with the second-to-last (counting from Z=0) button hole. You do not need to handle the case where holes.x is less than 2.

Non-functional Requirements

  • Manipulation of $f* values is forbidden
  • Using the minkowski() construct (in both 3D and 2D space) is forbidden
  • The ^ operator cannot be used
  • Using recursion is not recommended, nor is it needed to solve the assignment
  • Using external libraries (including the MCAD library) is forbidden
  • If something is forbidden, using it will cause tests to fail and you will receive 0 points
  • Your code must meet a certain quality standard (this part accounts for 5 points out of a possible 30)
    • Code repetition is bad — always use modules and loops
    • Magic constants must be accompanied by an explanatory comment
    • Maintain a logical level of indentation

Releases

No releases published

Packages

 
 
 

Contributors