Union of threads and cylinder "Shape is Invalid"

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
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!
dre99gsx
Posts: 29
Joined: Fri Oct 11, 2013 11:55 pm

Re: Union of threads and cylinder "Shape is Invalid"

Post by dre99gsx »

Gotcha, but it still doesn't make sense. This a bug or a rule?

The 2nd example I attached was based off of two sketches. One for the large cylinder, and then a second one to pocket an outer ring using the same face as the first sketch. Why wouldn't that variation work? Perhaps the Boolean function does not like to work with a solid which had a sketch that had been pocketed (instead of padded) over it? That is what seems to be the reason I could not get this to work.

This does cause an issue as the part that I'm trying to do this on is somewhat complex. Joining the sweep is the last step in which quite a few processes have been done to the smaller radius cylinder.

I've attached that part.
Attachments
CableRelief_USB.FCStd
(76.75 KiB) Downloaded 45 times
User avatar
NormandC
Veteran
Posts: 18588
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Union of threads and cylinder "Shape is Invalid"

Post by NormandC »

How are you creating your sweeps??? In all the files you posted they are non parametric. A sweep created with the Part Sweep tool should be linked to the helix and the sketch used as profile. Yours aren't.
dre99gsx wrote:Gotcha, but it still doesn't make sense. This a bug or a rule?
Nope, magic incantation. ;)

Seriously, creating threads is a nightmare because of quite a few bugs competing against each other. Most of the time I struggle with this. There have been multiple requests for a detailed tutorial on creating screw threads. I've refrained from creating one because I can't find a reliable method.
cblt2l wrote:normandc: maybe it is time for a stickied Thread thread
Heh. :)
dre99gsx
Posts: 29
Joined: Fri Oct 11, 2013 11:55 pm

Re: Union of threads and cylinder "Shape is Invalid"

Post by dre99gsx »

I hear you, and it is to be expected with software which is still under development. I wish I could find that one method that works for all scenarios, but if it these quirks are known issues that go deeper, than so be it. ;)

Regarding the helix, I used an old script which will sweep along a path. Heck, I think your name was on it!

Code: Select all

import Part, FreeCAD, math, PartGui, FreeCADGui
from FreeCAD import Base

# pick selected objects, where 1st selection is the trajectory and the 2nd is the section to sweep
s = FreeCADGui.Selection.getSelection()
try:
    shape1=s[0].Shape
    shape2=s[1].Shape
except:
    print "Wrong selection"

traj = Part.Wire([shape1])
section = Part.Wire([shape2])

# create a Part object into the active document
myObject=App.ActiveDocument.addObject("Part::Feature","Sweep")

makeSolid = 1
isFrenet = 1

# Create the 3D shape and set it to the Part object
Sweep = Part.Wire(traj).makePipeShell([section],makeSolid,isFrenet)
myObject.Shape = Sweep
The sweep becomes it's own shape with no parametric steps. Perhaps the Sweep tool can help reduce some of these issues. I had previously generated a coil using the Sweep tool (successfully), but ran into the same Boolean issues.

Well, in the end, looks like I need to think through my part construction a bit to get around this. Thanks!
andre
Posts: 96
Joined: Wed Nov 13, 2013 5:34 am

Re: Union of threads and cylinder "Shape is Invalid"

Post by andre »

Just wanted to update this thread on a method that has been working almost every time for me. I have been making threads using a helix of just one revolution (pitch = height). I wrote a macro that then copies that same thread as many times as I need, offseting each copy the same distance as the thread height. I then end up with a smooth thread.

This allows me to do boolean fusion or cuts without issue. I do rotate the thread slightly so that it does not start or stop at the same seam as the cylinder (thanks to the tips from here).

Something to try out if you run into trouble...
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Union of threads and cylinder "Shape is Invalid"

Post by ulrich1a »

andre wrote:Just wanted to update this thread on a method that has been working almost every time for me. I have been making threads using a helix of just one revolution (pitch = height). I wrote a macro that then copies that same thread as many times as I need, offseting each copy the same distance as the thread height. I then end up with a smooth thread.
A macro that works this way is available since a few month here: http://www.freecadweb.org/wiki/index.ph ... w_maker1_2
The latest version is posted here: viewtopic.php?f=3&t=5198&start=20#p41199
Post Reply