Search found 2602 matches
- Thu Jan 21, 2021 6:06 am
- Forum: Python scripting and macros
- Topic: Loft of two sections
- Replies: 18
- Views: 857
Re: Loft of two sections
Oh, indeed, sortEdges returns a list of lists. So this should be : sect1 = obj1.Shape.section(plane1) # this is a compound of edges wire1 = Part.Wire(Part.sortEdges(sect1.Edges)[0]) sect2 = obj2.Shape.section(plane2) # this is a compound of edges wire2 = Part.Wire(Part.sortEdges(sect2.Edges)) loft_s...
- Wed Jan 20, 2021 10:15 pm
- Forum: Python scripting and macros
- Topic: Loft of two sections
- Replies: 18
- Views: 857
Re: Loft of two sections
Or, if you don't wish to add the sections to the document : sect1 = obj1.Shape.section(plane1) # this is a compound of edges wire1 = Part.Wire(Part.sortEdges(sect1.Edges)) sect2 = obj2.Shape.section(plane2) # this is a compound of edges wire2 = Part.Wire(Part.sortEdges(sect2.Edges)) loft_shape = Par...
- Wed Jan 20, 2021 10:01 pm
- Forum: Python scripting and macros
- Topic: Loft of two sections
- Replies: 18
- Views: 857
Re: Loft of two sections
I have two Objects and I have created two planes that intersect the two objects. I have created two sections with Object.Shape.section(Plane) But it will not allow me to use these to create a loft as it seems it does not support such things as inputs to a loft. I get the following error File "...
- Wed Jan 20, 2021 3:49 pm
- Forum: Python scripting and macros
- Topic: Adding shape to scenegraph
- Replies: 9
- Views: 834
- Wed Jan 20, 2021 11:13 am
- Forum: Python scripting and macros
- Topic: Adding shape to scenegraph
- Replies: 9
- Views: 834
Re: Adding shape to scenegraph
Hi, Would this help ? : from pivy import coin def rootNode(shape, mode=2, deviation=0.3, angle=0.4): buf = shape.writeInventor(mode, deviation, angle) inp = coin.SoInput() inp.setBuffer(buf) node = coin.SoDB.readAll(inp) return node node = rootNode(my_shape) graph = Gui.ActiveDocument.ActiveView.get...
- Thu Jan 14, 2021 4:25 pm
- Forum: Python scripting and macros
- Topic: Scaling a part of a STEP file - revealed a weird thing about FreeCAD objects
- Replies: 13
- Views: 1198
Re: Scaling a part of a STEP file - revealed a weird thing about FreeCAD objects
This will happen if the supplied matrix contains a scaling that is not uniform on the 3 axis.
- Thu Jan 14, 2021 9:57 am
- Forum: Python scripting and macros
- Topic: Scaling a part of a STEP file - revealed a weird thing about FreeCAD objects
- Replies: 13
- Views: 1198
Re: Scaling a part of a STEP file - revealed a weird thing about FreeCAD objects
For scaling, you can have a look at transformGeometry, and transformShape :
Code: Select all
help(Part.Shape.transformGeometry)
help(Part.Shape.transformShape)
- Thu Jan 14, 2021 9:53 am
- Forum: Python scripting and macros
- Topic: Scaling a part of a STEP file - revealed a weird thing about FreeCAD objects
- Replies: 13
- Views: 1198
Re: Scaling a part of a STEP file - revealed a weird thing about FreeCAD objects
Some operations can be performed on a shape. For example a single-factor scaling : box = Part.makeBox(1,2,3) # box : <Solid object at 0x55f3e28db780> box.Volume # -> 6.0 box.scale(2.0, FreeCAD.Vector(0,0,0)) # box : <Solid object at 0x55f3e28db780> = same address box.Volume # -> 48.0 But I don't thi...
- Wed Jan 13, 2021 9:35 pm
- Forum: Open discussion
- Topic: BUG: SIGSEGV on create surface (SurfaceWB)
- Replies: 5
- Views: 500
Re: BUG: SIGSEGV on create surface (SurfaceWB)
The small edges of Surface_A and Surface_B have undefined Curve type. When clicking these edges with GeomInfo, from CurvesWB, I get this message in report view : 22:27:35 Traceback (most recent call last): File "/home/tomate/.FreeCAD/Mod/CurvesWB/freecad/Curves/GeomInfo.py", line 437, in a...
- Wed Jan 13, 2021 4:30 pm
- Forum: Python scripting and macros
- Topic: Scaling a part of a STEP file - revealed a weird thing about FreeCAD objects
- Replies: 13
- Views: 1198
Re: Scaling a part of a STEP file - revealed a weird thing about FreeCAD objects
1. Because each time you are querying a shape, you receive a new copy.
2. I think they are read-only. A shape is a complex hierarchical construction of subshapes. Modifying a subshape would brake the whole shape.
2. I think they are read-only. A shape is a complex hierarchical construction of subshapes. Modifying a subshape would brake the whole shape.