You can use Draft stuff on that surface the sketch is mapped to. The requirement is that the segments must match up well when arrayed, otherwise the array will not fuse them into a continuous wiggly ringsakudoo wrote:Or would you see another way to construct a much more versatile line?
Repeating pattern on a cylinder
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!
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: Repeating pattern on a cylinder
Re: Repeating pattern on a cylinder
Thanks a lot again for the very helpful hints.
It turned out however that I did not point out an essential requirement of my task: The wiggly line (going around the cylinder) shall have some undercuts, hence the proposed extrusion of the loft (along the cylinder axis) will intersect with itself and yield an incorrect result. For illustration see my little picture attached.
Is there a way in FreeCAD to cut a solid in two pars using an arbitrary surface? (In this way, one could use the loft surface to cut the cylinder into two parts and discard one of them.) - Sorry to bother you again!
It turned out however that I did not point out an essential requirement of my task: The wiggly line (going around the cylinder) shall have some undercuts, hence the proposed extrusion of the loft (along the cylinder axis) will intersect with itself and yield an incorrect result. For illustration see my little picture attached.
Is there a way in FreeCAD to cut a solid in two pars using an arbitrary surface? (In this way, one could use the loft surface to cut the cylinder into two parts and discard one of them.) - Sorry to bother you again!
- Attachments
-
- Pattern with undercut2.jpg (118.2 KiB) Viewed 2089 times
Re: Repeating pattern on a cylinder
Are you talking about a shape like this?
Loft won't work as you know because of self intersects, so I used a bit different workflow including ShapeBuilder to get the final shape.
Mark
OS: Kubuntu 14.04.3 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.5747 (Git)
Build type: Release
Branch: master
Hash: 2e6c94fc8e2641e26611632d95e6a28a1618aa89
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17-dev
Loft won't work as you know because of self intersects, so I used a bit different workflow including ShapeBuilder to get the final shape.
Mark
OS: Kubuntu 14.04.3 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.5747 (Git)
Build type: Release
Branch: master
Hash: 2e6c94fc8e2641e26611632d95e6a28a1618aa89
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17-dev
This post made with 0.0% Micro$oft products - GOT LINUX?
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: Repeating pattern on a cylinder
Sort of YES. One way pointed by Mark. There is another, probably less messy, but involves python console.sakudoo wrote:Is there a way in FreeCAD to cut a solid in two pars using an arbitrary surface?
Type:
Code: Select all
Part.show(App.ActiveDocument.Loft.Shape.copy().makeHalfSpace(App.Vector(0,0,0)))
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: Repeating pattern on a cylinder
I think we need a gui tool for making half-spaces. It is so easy. I think I will bother to make it and pull request.
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: Repeating pattern on a cylinder
Oh no! It can be done with Gui! There is a command "Convert to solid", which, when applied to Loft, seems to produce the same result.
Re: Repeating pattern on a cylinder
hi
may be Python best friend FreeCAD
mario
may be Python best friend FreeCAD
Code: Select all
import FreeCAD, Draft, Part
from FreeCAD import Base
__title__ = "Macro_Mills"
__author__ = "Mario52"
__date__ = "17/10/2015"
__url__ = "http://www.freecadweb.org/index-fr.html"
__version__ = "00.01"
#################### create new document if not existe ##################
doc = FreeCAD.ActiveDocument ####
if doc == None: ####
doc = FreeCAD.newDocument() ####
#########################################################################
############## Modify here ####################
nombre = 36 # number objects for 1 turn must sous multiple of 360 ex 20, 10, 36 ...
rayon = 20 # radius (axe to object)
hauteur = 5 # heigth header (tooth)
offset = 20 # offset decallage (- direction left, + directon rigth, 0 center )
###############################################
vecligne=[FreeCAD.Vector(0.0,0.0,0.0),FreeCAD.Vector(rayon,0.0,0.0)] # vector for line directrice
ligne = Draft.makeWire(vecligne,closed=False,face=False,support=None) # creation de la ligne de base 1 principale
ligne2 = Draft.makeWire(vecligne,closed=False,face=False,support=None) # creation de la ligne de base 2 (retrait)
coor_X = 0.0
coor_Y = 0.0
coor_Z = 0.0
coor_X2 = 0.0
coor_Y2 = 0.0
coor_Z2 = 0.0
comptF = pas = 0
points = []
del points[:]
comP = []
del comP[:]
for i in range(0,360,((360/nombre))): # boucle principale 0 to 360 degrees
FreeCAD.ActiveDocument.getObject(ligne.Name).Placement=App.Placement(App.Vector(0.0,0.0,coor_Z), App.Rotation(App.Vector(0,0,1),i), App.Vector(0,0,0))
a = ligne.Shape.Edges[0].Vertexes[1] # fin de la ligne 1 de base principale
coor_X = (a.Point.x)
coor_Y = (a.Point.y)
# p1 = Draft.makePoint(coor_X,coor_Y,coor_Z) # create point green (line 1)
# FreeCADGui.ActiveDocument.getObject(p1.Name).PointColor = (0.0,1.0,0.0) # create point green (line 1)
FreeCAD.ActiveDocument.getObject(ligne2.Name).Placement=App.Placement(App.Vector(0.0,0.0,coor_Z2), App.Rotation(App.Vector(0,0,1),(i-offset)), App.Vector(0,0,0))
aa = ligne2.Shape.Edges[0].Vertexes[1] # fin de la ligne 2 de base principale
coor_X2 = (aa.Point.x)
coor_Y2 = (aa.Point.y)
# p2 = Draft.makePoint(coor_X2,coor_Y2,coor_Z2) # create point red (line 2)
# FreeCADGui.ActiveDocument.getObject(p2.Name).PointColor = (1.0,0.0,0.0) # create point red (line 2)
if pas == 1:
coor_Z = hauteur
points += [FreeCAD.Vector(coor_X,coor_Y,coor_Z)]
pas = 0
else:
coor_Z2 = 0
points += [FreeCAD.Vector(coor_X2,coor_Y2,coor_Z2)]
pas = 1
###################
# points += [points[-1]] # create eventail (bonus)
###################
# shell = Draft.makeWire(points,closed=True,face=True) # create a shell (bonus)
# shell.Label = "Shell"
####################
#contour = Draft.makeWire(points,closed=True,face=True) # create contour makeWire
#contour.Label = "ContourWire"
####################
#contour = Draft.makeBSpline(points,closed=True,face=True) # create contour makeBSpline
#contour.Label = "ContourBSpline"
########################### section create object face #####################
a = []
del a[:]
coor_X = coor_Y = coor_Z = 0.0
for i in range(nombre): # create faces
a += [(points[i])]
try:
a += [(points[i+1])]
except Exception:
a += [(points[0])]
a += [(FreeCAD.Vector(coor_X,coor_Y,coor_Z))]
##
ressort = Draft.makeWire(a,closed=True,face=True) # makeWire
##
# ressort = Draft.makeBSpline(a,closed=True,face=True) # makeBSpline
##
ressort.MakeFace = True
del a[:]
App.ActiveDocument.removeObject(ligne.Name) # remove ligne de base directrice 1
App.ActiveDocument.removeObject(ligne2.Name) # remove ligne de base directrice 2
FreeCAD.ActiveDocument.recompute()
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
My macros on Gist.github here complete macros Wiki and forum.
Re: Repeating pattern on a cylinder
Hi DeepSOICDeepSOIC wrote:I think we need a gui tool for making half-spaces. It is so easy. I think I will bother to make it and pull request.
Yorik started what became a four page topic on creating a HalfSpace tool a while ago...I found a the topic, here is the link.
viewtopic.php?f=8&t=6371
Jim
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: Repeating pattern on a cylinder
Thanks for the link, Jim! I had some diagonal reading, and it gave me a sence of a discussion that ended with no decision.
Re: Repeating pattern on a cylinder
Mario, have you ever modeled something in FreeCAD using the GUI without writing a special macro ?mario52 wrote:Python best friend FreeCAD
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.