OpenSCAD part separates when split to objects but shouldn't

Folks, I’ve been struggling with this problem for 2 days now and can’t
see what the cause is, and at this point I think I need to ask for help.

I’m building a shell for a videogame PCB and one of the beta-testers
suggested adding an extra small ledge to the top part of the shell, to
clamp the PCB in place more tightly. I did this, and it worked, but
in a subsequent iteration this part has somehow become disconnected from
the rest of the model - when you separate it into objects in Bambu Studio,
and reposition the part that it is supposed to be attached to, it stays
in place (and I think may also have dropped in the Z axis to touch the
base plate).

I’ve been careful to make sure that the part does properly overlap the
rest of the top shell it’s supposed to be attached to, when it is unioned
with the rest of the part.

In file http://gtoal.com/OpenSCAD/pitrex-0.1.19.scad (which uses BOSL2) the problematic
part is in the line marked by this comment:

<------------- THIS IS THE PART THAT IS DISCONNECTED FROM THE REST OF THE OBJECT!

When rendered in OpenSCAD it looks correct:


but when you split to parts and move the relevant part, that ledge gets
left behind:


I only have one clue that may be helpful… when you import the project into Bambu Studio and before separating into parts, if you change the filament,
you’ll notice that the problematic part stays in the original filament colour.


I can’t tell if the problem is in my OpenSCAD code, or OpenSCAD itself, or Bambu Studiio. Any hints would be appreciated. Thanks.

Hi @gtoal,

I can not tell you what exactly happens. But the solution is to replace the prism() call.

I use OpenSCAD in PHPStorm (with OpenSCAD Plugin) and there I can jump to the implementation.

And in your case it showed that it comes from a file bosl1compat.scad which indicates that there is an compatibility layer which may no longer work as expected. Or your Implementation with polyhedron has faces that are not propperly aligned. (Try to avoid polyhedron, or add testing stuff to ensure that polyhedron does not break something.)

I just replaced the prism() by soming else (not the right shape and position)
and then I stays conneced in BambuStudio

I guess you can make it with prismoid() or wedge()

Hope that helps

2 Likes

Oh! - I didn’t get your explanation until I went in to fix it… sorry, I see now what you were saying was that the prism() call I was using was the one I wrote, not the BOSL2 one, and that it was faulty. (I initially thought you were saying that it was the BOSL2 implementation of prism that was faulty.) So I’ll take that out and use the wedge call from BOSL2 instead (at least until I can understand why my prism() call didn’t work as expected.)

That also explains why it initially had worked and then stopped working in a later revision - it was because I had started removing the dependency on BOSL2 and was replacing some of their modules with my own local versions. I guess I initially missed the breakage because when I tested that update I hadn’t needed to remove any of the parts from the plate before printing. (Usually I just print the parts that have changed but that time I must have reprinted the entire model, and it was only when the items were split that the problem surfaced.) Lessons learned.

Thanks for finding it! Much appreciated. I’ve now released the project here at Pitrex (Vectrex) cartridge by gtoal MakerWorld: Download Free 3D Models

Graham

1 Like