hominoids / SBC_Case_Builder

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

Case accessories break when changing offsets #8

Closed davejlong closed 1 year ago

davejlong commented 1 year ago

When changing the offset, for example case_offset_tz, case accessories break. For example, when applying a fan cutout to a case, if I change the case_offset_tz to something like 15, the cutout is moved away from the case. Issue only seems to be with accessories from sbc_case_builder_accessories.cfg. Using the customizer dropdowns for colling, gpio openings and vents works as expected.

A solution that seems relatively logical on the surface is to remove the loc_z value from the accessories schema. Alternatively, maybe make loc_x, loc_y, and loc_z relative based on the case?

hominoids commented 1 year ago

The accessories were intentionally implemented as absolute coordinates without any implied relationship to the case or SBC. When this originally came up I had just started implementing accessories and didn’t have a good understanding of the nuances of implementing parametric positioning for them at the time. The decision was made to use absolute positioning for accessories and to associate any SBC component opening or features(GPIO, heatsink, UART, etc) directly to the responsible SBC component contained in sbc_model_framework.cfg. So the feature openings for GPIO and cooling in sbc case builder are created when there is a GPIO header component and/or a heatsink for the given SBC and uses their positions. That’s why there is an accessory set for any SBC that has no OEM heatsink, to provide the type and location for a fan/vent opening. Likewise, if a SBC doesn’t have a GPIO header, the opening doesn’t appear for the same reason even if they are enabled. It also can be added as an dissociated absolute accessory if needed.

All that said, I think parametric positioning of accessories is achievable. Your solution covers one possible scenario but I believe there are at least three situations(absolute, SBC associated and case associated positioning) that need to be implemented to address parametric accessories adequately. In your example the fan position needs to be parametric to the SBC so when the SBC is moved the fan opening is moved, SBC associated parametric positioning. For other accessories case associated parametric positioning will be needed; consider a UART and opening at each face of a case. What axis to use for case parametric adjustments is not intuitive or uniform across the faces. Since the users intent is not implied or known the affected axis(s) must be given.

I have been working towards the release of version 2.0 but I’ll take a look at whether I can get this done in a timely manner to include in version 2.0 since it will require a schema change for the accessories.

davejlong commented 1 year ago

What if the user selects to add a fan openeing, in a case where the board doesn't have an OEM heatsink, to just create a fan opening either centered on the board or centered over SOC1?

hominoids commented 1 year ago

That can be done now with an accessory but if you mean automated there is at least one issue, I don’t know if there is a heatsink or not for any given SBC. Right now the algorithm works on SBC components that are in the list. Knowing what is not there requires a different approach, the SBC components would need to be parsed ahead of time and flags set and checked. I have thought about developing this for other reasons, but not good enough ones as of yet. Another approach would be using the SOC for all cooling openings, instead of the heatsink. One issue with this approach is that SOC data is not always available. Some OEM don’t provide that Mechanical information. If you look at the SBC added recently in SBC Model Framework, some have comments that the SOC data is missing. This doesn’t stop a case from being made right now but it isn’t and shouldn’t be relied on either. As the SOC data matures it might make more sense to look at the SOC approach to locate cooling in the future. I have some other cooling options I would like to add that need the SOC data. Regardless of the approach, this will be achievable using an accessory(fan opening) associated to the SBC, centered as needed.

hominoids commented 1 year ago

The first attempt at accessory associative parametric positioning is done.