Hi guys, I've created a cylinder(vessel) and now trying to place other small cylinders around it. The small cylinders are simply drawn connections. How can I rotate the connections around the vessel? I want to place more than one connection around the vessel but at different height and different angle, and of course the radius (the distance from the center of the vessel to the outside surface) should be the same for each of them (100)
import Mesh
import math
import Draft
import ImportGui; import Part; from FreeCAD import Base
doc = FreeCAD.newDocument()
#The vessel:
cyl = doc.addObject("Part::Cylinder","Vessel")
cyl.Placement.Base = (0,0,0)
cyl.Radius = 100;
cyl.Height = 200;
#dimension of the connections:
cyl_con = Part.makeCylinder(25,40,Base.Vector(0,0,0))
Rotating a part around an axis in Script
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Be nice to others! Read the FreeCAD code of conduct!
- Shalmeneser
- Veteran
- Posts: 9560
- Joined: Wed Dec 23, 2020 12:04 am
- Location: Fr
Re: Rotating a part around an axis in Script
Put your code between '[ c o d e' tags :
(provide your version info)
(provide your version info)
Code: Select all
import Mesh
import math
import Draft
import ImportGui; import Part; from FreeCAD import Base
doc = FreeCAD.newDocument()
#The vessel:
cyl = doc.addObject("Part::Cylinder","Vessel")
cyl.Placement.Base = (0,0,0)
cyl.Radius = 100;
cyl.Height = 200;
#dimension of the connections:
cyl_con = Part.makeCylinder(25,40,Base.Vector(0,0,0))
-
- Veteran
- Posts: 3180
- Joined: Thu Sep 24, 2020 10:31 pm
- Location: Hawaii
- Contact:
Re: Rotating a part around an axis in Script
Consult https://wiki.freecadweb.org/Sandbox:Edw ... _rotations - if I understand what you are trying to do.