Problem cutting a hole
Forum rules
and Helpful information
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help
Also, be nice to others! Read the FreeCAD code of conduct!
Also, be nice to others! Read the FreeCAD code of conduct!
-
- Posts: 8
- Joined: Sat Apr 16, 2011 8:15 am
Problem cutting a hole
Hi All,
My design is coming on nicely, taking on board previous suggestions / comments!
I have hit a problem using 'cut', which is strange as I have used 'cut' lots of times in the design, yet this one is doing something different.
In short, I have built up a body (body8), and am attempting to 'cut' a hole in the side for a cable gland. I have made a suitable cylinder (10.5mm dia, that sits in the right place), but when I perform the cut to make body9, there is no hole! The view is strange, almost as if the cylinder has zero wall thickness rather than being a solid?
I've attached the design (apologies for the size, but I've left everything in there).
EDIT - clearly not - maybe it is too big for the forum. It's here instead:
http://www.cowdery.org.uk/downloads/Lamp7.FCStd1
Any help gratefully appreciated.
Thanks,
Chris.
My design is coming on nicely, taking on board previous suggestions / comments!
I have hit a problem using 'cut', which is strange as I have used 'cut' lots of times in the design, yet this one is doing something different.
In short, I have built up a body (body8), and am attempting to 'cut' a hole in the side for a cable gland. I have made a suitable cylinder (10.5mm dia, that sits in the right place), but when I perform the cut to make body9, there is no hole! The view is strange, almost as if the cylinder has zero wall thickness rather than being a solid?
I've attached the design (apologies for the size, but I've left everything in there).
EDIT - clearly not - maybe it is too big for the forum. It's here instead:
http://www.cowdery.org.uk/downloads/Lamp7.FCStd1
Any help gratefully appreciated.
Thanks,
Chris.
Re: Problem cutting a hole
Hi, I just had a look at your file, it's pretty stange indeed...
The cylinder looks OK, the body8 is a compound containing 2 solids, but even if i do the cut between the cylinder and the first solid, I get the same result as yours... I suppose there is something wrong somewhere in that solid but not too sure how to detect and heal...
If it was mine, I think I'd simply try to heal by adding the missing portion by hand, but probably someone else will have a better idea.
BTW your example makes me think we would need a python way to retrieve an object by label name
The cylinder looks OK, the body8 is a compound containing 2 solids, but even if i do the cut between the cylinder and the first solid, I get the same result as yours... I suppose there is something wrong somewhere in that solid but not too sure how to detect and heal...
If it was mine, I think I'd simply try to heal by adding the missing portion by hand, but probably someone else will have a better idea.
BTW your example makes me think we would need a python way to retrieve an object by label name
Re: Problem cutting a hole
I was wondering if the fact that the cylinder cuts through many residual (joined) faces causes the problem (I read your "old fuse" topic Yorik, and these residual faces produced by the regular "modern" fuse are sure annoying - its a big OCC defect IMHO, as no other geometric kernel that I know of does that).
But I made a sketch of a circle (with the sketch feature) on the exterior face and used the pocket feature from the Part Design Workbench, and it works.
Drew a circle in 2d Draft, extruded it then cut the Body8 shape, it worked too, which is odd since it's the same process as using a cylinder primitive, why does one process work and the other won't?
At least you've got those two working alternate methods to make your hole. Nice design BTW, that's the most intricate I've seen modeled in FreeCAD so far.
But I made a sketch of a circle (with the sketch feature) on the exterior face and used the pocket feature from the Part Design Workbench, and it works.
Drew a circle in 2d Draft, extruded it then cut the Body8 shape, it worked too, which is odd since it's the same process as using a cylinder primitive, why does one process work and the other won't?
At least you've got those two working alternate methods to make your hole. Nice design BTW, that's the most intricate I've seen modeled in FreeCAD so far.
- Attachments
-
- lamp7_pocket.jpg (15.33 KiB) Viewed 2501 times
Re: Problem cutting a hole
You're absolutely right and that's why I have added the method getObjectsByLabel to the document class.BTW your example makes me think we would need a python way to retrieve an object by label name
Note: You probably have noticed the plural form. This is because in FreeCAD it's allowed that several objects have the same label.
Using this function and checking the Body8 compound it seems that one solid is broken.
Code: Select all
l=App.ActiveDocument.getObjectsByLabel("Body8")[0]
l.Shape.ShapeType
s1=l.Shape.Solids[0]
s2=l.Shape.Solids[1]
s1.isValid() # returns false
s2.isValid()
Re: Problem cutting a hole
There are definitely some free edges in the solid model which probably causes the boolean operation to fail. Attached you'll get a project file with these free edges (just remove the .zip extension). However, at the moment I have no idea how to fix these issues.
- Attachments
-
- free_edges.fcstd.zip
- (17.95 KiB) Downloaded 48 times
-
- Posts: 8
- Joined: Sat Apr 16, 2011 8:15 am
Re: Problem cutting a hole
I took the suggestion of drawing a circle, extruding it, and cutting with that. It worked OK, thanks normandc for the suggestion.
wmayer - I downloaded the free-edges file, but I can't see anything?! How should I be viewing it?
Which does give rise to a question - I have been viewing the design with the 7 different buttons on the toolbar. The only other way I have found is to use the turntable and stop it at the appropriate time. Is there a 3D yaw/roll/pitch/whatever system for getting arbitrary viewpoints? (apologies if the answer is RTFM!)
Further, is my general approach to building up my 3D shape about right?, or is there a better way to do it? Is there a way to 'consolidate' the shape to a single primitive?
Thanks for all your help.
Chris.
wmayer - I downloaded the free-edges file, but I can't see anything?! How should I be viewing it?
Which does give rise to a question - I have been viewing the design with the 7 different buttons on the toolbar. The only other way I have found is to use the turntable and stop it at the appropriate time. Is there a 3D yaw/roll/pitch/whatever system for getting arbitrary viewpoints? (apologies if the answer is RTFM!)
Further, is my general approach to building up my 3D shape about right?, or is there a better way to do it? Is there a way to 'consolidate' the shape to a single primitive?
Thanks for all your help.
Chris.
Re: Problem cutting a hole
Left + Middle mouse buttonschrisjc31415 wrote:Which does give rise to a question - I have been viewing the design with the 7 different buttons on the toolbar. The only other way I have found is to use the turntable and stop it at the appropriate time. Is there a 3D yaw/roll/pitch/whatever system for getting arbitrary viewpoints? (apologies if the answer is RTFM!)
About your design technique, I'd say you've gone pretty far! And your model, excepting these little problems, is very neat. So, I'd say your technique is very right!
The problems we have with booleans operations leaving little facets in everything is inherent to OpenCascade, and at the moment we have to live with it. But, there is an incredible community effort happening now around opencascade, so who knows, things could evolve fast!
Re: Problem cutting a hole
Does a "Fit all" work for you? If not, which version do you have? Nevertheless, you can also select your solid "body8" and select for Lighting "One side" in the property editor tab "View". This causes to show internals in a darker colour and you'll see very quickly where the holes are.wmayer - I downloaded the free-edges file, but I can't see anything?! How should I be viewing it?
-
- Posts: 8
- Joined: Sat Apr 16, 2011 8:15 am
Re: Problem cutting a hole
Ah, trackpad + 2 button! I discovered 'Inventor' navigation means I can use the left button for spin etc.yorikvanhavre wrote: Left + Middle mouse buttons
wmayer - the single light source idea does show the hole. I have no idea why it's there, it appears to be the result of a faulty union between Body6 and ScrewHolders. Each item by itself is OK, but the union is faulty. I have some ideas to try to fix it.
http://www.cowdery.org.uk/downloads/Lamp8.FCStd if you fancy a play.
I exported to STL, and a third party viewer confirmed the hole is actually there.
Once I've fixed it, I'm ready to scare myself getting prices for manufacture of a single piece
Chris.