Search found 1260 matches

Go to advanced search

by Chris_G
Sun Apr 05, 2020 8:16 pm
Forum: Python scripting and macros
Topic: Trying to script a boolean subtract operation
Replies: 8
Views: 550

Re: Trying to script a boolean subtract operation

Code: Select all

result = input_shape.cut(tool_shape)
# or
result = input_shape.cut(list_of_tool_shapes)
# or
result = input_shape.cut(list_of_tool_shapes, tolerance=1e-3)
by Chris_G
Sun Apr 05, 2020 5:42 pm
Forum: Help on using FreeCAD
Topic: Graphic to a cylindric surface ?
Replies: 29
Views: 552

Re: Graphic to a cylindric surface ?

You need to update the Curves Workbench
by Chris_G
Sun Apr 05, 2020 5:10 pm
Forum: Help on using FreeCAD
Topic: Graphic to a cylindric surface ?
Replies: 29
Views: 552

Re: Graphic to a cylindric surface ?

- Select your sketch.
- In the Attachment properties
- Click the Map Mode Value, then click the box with three points
- It will wait for a selection.
- click the cylinder face in the 3D view, then OK
- your sketch should now have its Support property set to "Cylinder [Face1]"
sketch.png
sketch.png (71.11 KiB) Viewed 40 times
by Chris_G
Sun Apr 05, 2020 4:41 pm
Forum: Help on using FreeCAD
Topic: Graphic to a cylindric surface ?
Replies: 29
Views: 552

Re: Graphic to a cylindric surface ?

2) How do I position a whole sketch (I do have the sketch an need to move it translatory from one point to another)? You don't. You'd better move the blue rectangle. If your target face is a cylinder, you can constraint your blue rectangle to Cylinder.Height and 2*pi*Cylinder.Radius. Then you can s...
by Chris_G
Sat Apr 04, 2020 9:03 pm
Forum: Help on using FreeCAD
Topic: Graphic to a cylindric surface ?
Replies: 29
Views: 552

Re: Graphic to a cylindric surface ?

Hi,
Yes, I did a big rework of Sketch_on_surface.
Here is a little doc on how it works now :
https://wiki.freecadweb.org/Curves_SketchOnSurface
by Chris_G
Sat Apr 04, 2020 3:43 pm
Forum: Python scripting and macros
Topic: Script to slice a cylinder.
Replies: 13
Views: 218

Re: Script to slice a cylinder.

I changed the code to the following, don't really understand the (1,1) but (1,1) are u,v parameters on the face. Since the face is planar, the normal should be the same for any u,v. However, the normal's length is 1.0 So, the height of the extrude is 1.0 too. So the function will return a thin slic...
by Chris_G
Sat Apr 04, 2020 2:59 pm
Forum: Python scripting and macros
Topic: Script to slice a cylinder.
Replies: 13
Views: 218

Re: Script to slice a cylinder.

Ah makes more sense, penny is slowly dropping that Part makes Shapes. Just to be clear : - Part.Plane() create a geometry / Part. make Plane() create a shape - Part.Cylinder() create a geometry / Part. make Cylinder() create a shape ... and so on Does not like plane.Axis*1e10. Ooops, sorry, I didn'...
by Chris_G
Sat Apr 04, 2020 1:31 pm
Forum: Python scripting and macros
Topic: Script to slice a cylinder.
Replies: 13
Views: 218

Re: Script to slice a cylinder.

When I create a Plane with topPlane = Part.makePlane(100, 100, FreeCAD.Vector(0,0,5),FreeCAD.Vector(1,0,1)) and call I get error f = plane.toShape() <class 'AttributeError'>: 'Part.Face' object has no attribute 'toShape' My example code was suppose to work with a geometry plane. The Part.makeSometh...
by Chris_G
Sat Apr 04, 2020 9:32 am
Forum: Python scripting and macros
Topic: Script to slice a cylinder.
Replies: 13
Views: 218

Re: Script to slice a cylinder.

Code: Select all

def cut_cylinder_with_plane(cyl, plane):
    "Cut a cylinder with a plane"
    f = plane.toShape()
    so = f.extrude(plane.Axis*1e10)
    cut = cyl.cut(so)
    common = cyl.common(so)
    return cut, common
by Chris_G
Sat Apr 04, 2020 7:05 am
Forum: Python scripting and macros
Topic: Script to slice a cylinder.
Replies: 13
Views: 218

Re: Script to slice a cylinder.

Okay I can create a cylinder with Part.makeCylinder although when I try with cyl = Part.makeCylinder(radius,height,[pnt,dir,angle]) it does not like the third parameter, complains it is not a list and wants a Vector. The brackets don't stand for a python list, but mean that these parameters are opt...

Go to advanced search