Ciao a tutti, qualcuno saprebbe dirmi dove sbaglio? MI viene tutto storto, mentre l'estrusione me la aspettavo perpendicolare.
Allego il mio file.
Grazie a tutti.
Torsione di uno sketch (Risolto!)
Forum rules
regole del forum e le informazioni utili
Importante: PRIMA di chiedere aiuto leggete qui!
regole del forum e le informazioni utili
Importante: PRIMA di chiedere aiuto leggete qui!
Re: Torsione di uno sketch (Risolto!)
- Attachments
-
- test_sweep.FCStd
- (19.11 KiB) Downloaded 37 times
-
- Veteran
- Posts: 2611
- Joined: Tue Feb 21, 2012 8:07 pm
- Location: Torino - Italy
Re: Torsione di uno sketch (Risolto!)
Imposta Frenet su true. Proprietà Dati -> Frenet
Re: Torsione di uno sketch (Risolto!)
renatorivo ti ringrazio davvero. Ciao!
Re: Torsione di uno sketch (Risolto!)
Il Loft in effetti è un pochino una rogna, perché cerca di interpolare le differenze di forma e non è mica chiaro come lo faccia.
Più tardi posto un esempio.
Più tardi posto un esempio.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
-
- Veteran
- Posts: 2611
- Joined: Tue Feb 21, 2012 8:07 pm
- Location: Torino - Italy
Re: Torsione di uno sketch (Risolto!)
Queste due pagine non sono esaustive, ma chiariscono perlomeno diversi aspetti e regole di base a cui attenersi affinché l'operazione abbia successo:
https://wiki.freecadweb.org/Part_Loft/it
https://wiki.freecadweb.org/Part_Loft_T ... Details/it
https://wiki.freecadweb.org/Part_Loft/it
https://wiki.freecadweb.org/Part_Loft_T ... Details/it
Re: Torsione di uno sketch (Risolto!)
Ecco un codice divertente:
Divertente?
beh si provate a modificare
E viene fuori una cosa strana.
PS modificando opportunamente i valori
potete ottenere quello che volete, modificando i lati e il diametro del poligono anche.
Saluti
Carlo D.
Code: Select all
"""special-loft.py
Author: Carlo Dormeletti
Copyright: 2020
Licence: CC BY-NC-ND 4.0 IT
"""
import os
import FreeCAD
from FreeCAD import Base, Vector
import Part
import Draft
from math import pi, sin, cos
DOC = FreeCAD.activeDocument()
DOC_NAME = "Pippo"
def clear_doc():
"""
Clear the active document deleting all the objects
"""
for obj in DOC.Objects:
DOC.removeObject(obj.Name)
def setview():
"""Rearrange View"""
FreeCAD.Gui.activeDocument().activeView().viewAxometric()
FreeCAD.Gui.activeDocument().activeView().setAxisCross(True)
DOC.recompute()
FreeCAD.Gui.SendMsgToActiveView("ViewFit")
if DOC is None:
FreeCAD.newDocument(DOC_NAME)
FreeCAD.setActiveDocument(DOC_NAME)
DOC = FreeCAD.activeDocument()
else:
clear_doc()
# EPS= tolerance to uset to cut the parts
EPS = 0.10
EPS_C = EPS * -0.5
def reg_poly(center=Vector(0, 0, 0), sides=6, dia=6,
align=0, outer=1):
"""
This return a polygonal face
Keywords Arguments:
center - Vector holding the center of the polygon
sides - the number of sides
dia - the diameter of the base circle
(aphotem or externa diameter)
align - 0 or 1 it try to align the base with one axis
outer - 0: aphotem 1: outer diameter (default 1)
"""
ang_dist = pi / sides
if align == 0:
theta = 0.0
else:
theta = ang_dist
if outer == 1:
rad = dia * 0.5
else:
# dia is the apothem, so calculate the radius
# outer radius given the inner diameter
rad = (dia / cos(ang_dist)) * 0.5
vertex = []
for n_s in range(0, sides+1):
vpx = rad * cos((2 * ang_dist * n_s) + theta) + center[0]
vpy = rad * sin((2 * ang_dist * n_s) + theta) + center[1]
vertex.append(Vector(vpx, vpy, 0))
obj = Part.makePolygon(vertex)
wire = Part.Wire(obj)
poly_f = Part.Face(wire)
return poly_f
def test_loft():
shapes = []
sections = 10
height = 60
for idx in range(0, sections) :
poly_e = reg_poly(Vector(0,0,0), 4, 10, 0, 0)
step = height / sections
obj = DOC.addObject("Part::Feature", "forma_" + str(idx))
obj.Shape = poly_e
obj.Placement = FreeCAD.Placement(Vector(0,0,idx * step), FreeCAD.Rotation(idx * 30, 0, 0) )
shapes.append(obj)
obj_f = DOC.addObject('Part::Loft','Loft')
obj_f.Sections = shapes
obj_f.Solid = True
obj_f.Ruled = False
obj_f.Closed = False
DOC.recompute()
return obj_f
# create object
test_loft()
DOC.recompute()
setview()
beh si provate a modificare
Code: Select all
obj_f.Ruled = False
obj_f.Closed = True
PS modificando opportunamente i valori
Code: Select all
sections = 10
height = 60
Saluti
Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/