hominoids / SBC_Case_Builder

Autonomous SBC case generation using SBC Model Framework
GNU General Public License v3.0
381 stars 24 forks source link

Case indents not working #16

Closed davejlong closed 2 years ago

davejlong commented 2 years ago

Case indents for IO openings doesn't seem to be working.

image

Customizer values are:

        "test_indents": {
            "$fn": "90",
            "accessory_highlight": "false",
            "accessory_name": "rpi4b_shell",
            "adjust": "0.01",
            "bottom_ext_standoff": "[6.75, 5, 3.6, 10, 4, 1, 0, 0, 0, 4.5, 5.1]",
            "bottom_front_left": "0",
            "bottom_front_right": "0",
            "bottom_rear_left": "0",
            "bottom_rear_right": "0",
            "bottom_standoff": "[6.75, 7, 3.6, 10, 4, 1, 0, 0, 0, 4.5, 5.1]",
            "c_fillet": "3",
            "case_design": "shell",
            "case_ext_standoffs": "false",
            "case_ffn": "90",
            "case_fn": "360",
            "case_offset_bz": "0",
            "case_offset_tz": "0",
            "case_offset_x": "0",
            "case_offset_y": "0",
            "case_style": "none",
            "cooling": "fan",
            "exhaust_vents": "vent",
            "fillet": "3",
            "floorthick": "2",
            "gap": "1",
            "gpio_opening": "none",
            "indents": "true",
            "lip": "5",
            "lower_bottom": "0",
            "move_front": "0",
            "move_leftside": "0",
            "move_rear": "0",
            "move_rightside": "0",
            "pcb_loc_x": "0",
            "pcb_loc_y": "0",
            "pcb_loc_z": "0",
            "raise_top": "0",
            "sata_punchout": "false",
            "sbc_bottom_standoffs": "true",
            "sbc_highlight": "false",
            "sbc_model": "rpi4b",
            "sbc_off": "false",
            "sbc_top_standoffs": "true",
            "sidethick": "2",
            "sidewall_support": "true",
            "tol": "0.25",
            "top_ext_standoff": "[6.75, 18, 2.5, 10, 4, 4, 0, 1, 0, 4.5, 5.1]",
            "top_front_left": "0",
            "top_front_right": "0",
            "top_rear_left": "0",
            "top_rear_right": "0",
            "top_standoff": "[6.75, 18, 2.5, 10, 4, 4, 0, 1, 0, 4.5, 5.1]",
            "view": "model",
            "vu_rotation": "[15, 0, 0]",
            "wallthick": "2"
        }
davejlong commented 2 years ago

It looks to be a limitation of the indents logic. I found that indents only work for:

Perhaps there's a better way to generate the indents based on the shape in SBC_Model_Framework instead of creating new shapes in the case builder.

hominoids commented 2 years ago

Your correct, I have only implemented a small number of components and orientations. It is the last item on my issue list currently and will be addressed in the future. I'm not planning to implement indents for every component, just some specific ones make sense, but in all orientations.

davejlong commented 2 years ago

Can you offer some insight into the math behind building them? I wanted to add them for a few basics that I think follow the same logic you already have: USB-C, Micro HDMI and 3.5mm Audio Jack (all on the RPi4B).

Looking at adding them, using the slot(hole,length,depth) module, it seems like there might be a slight problem with the logic. In the SBC_Model_Framework's USB-C, the hull properly takes into account that cylinders are centered, whereas slot doesn't, so the size of the slot will actually be larger than specified in the length parameter. Not sure if this was by design or not.

hominoids commented 2 years ago

Both approaches are correct but differ on their goal. For slot() total length = length + hole diameter. That allows a rectangular object who's width is equal to length to be but in the slot. The other example, total length = length - hole diameter, so the width is slot length only, a rectangular object of width length would not necessarily fit in the slot.

What shape and size indent to use is driven by the type of cable connector housing. Look at the indents already implemented as examples and do something similar of reasonable size and shape to the housing of the cable. Most cable housings are either rectangular or round so I used an appropriate size slot for rectangles and a cylinder for round. A more structured approach may have to be implemented for all the orientations, similar to what was done for mask().

hominoids commented 2 years ago

Are you working on this issue?

davejlong commented 2 years ago

I'll take care of adding the indents for USB-C, Micro HDMI and 3.5mm Audio.

hominoids commented 2 years ago

The rewrite of the indent is complete with more components added and all orientations adjusted. All support SBC top and bottom side placement except the power plugs and the audio jack which are only supported on the top side at this time. I have never seen either of these on the bottom of a SBC but they can be easily added if needed in the future. I didn't find any related work in your repositories so I did all of the currently requested components. Indents supported are hdmi_a,hdmi_mini,hdmi_micro,pwr5.5_7.5x11.5,pwr2.5_5x7.5,usb2-micro,usbc-single_horizontal and audio-jack_3.5.