6 from salome.shaper import model
8 partset = model.moduleDocument()
9 part = model.addPart(partset).document()
10 plane = model.defaultPlane("XOY")
11 sketch = model.addSketch(part, plane)
12 p1 = sketch.addPoint(0, 0)
13 p2 = sketch.addPoint(0, 1)
14 p3 = sketch.addPoint(1, 1)
15 p4 = sketch.addPoint(1, 0)
16 sketch.addPolygon(p1.pointData(), p2.pointData(), p3.pointData(), p4.pointData())
18 Provided that a sketch has been created before an extrusion can then be created
19 by the following code:
23 >>> base = sketch.selectFace()
24 >>> extrusion = model.addExtrusion(part, base, 10)
25 >>> # Modification of the extrusion
26 >>> extrusion.setSize(20)
28 All the ways to create an extrusion and the data access and modification methods
29 of the extrusion are documented below
34 .. autofunction:: model.addExtrusion
39 .. autoclass:: model.features.extrusion.Extrusion
42 Create an Extrusion Bolean
43 --------------------------
45 .. autofunction:: model.addExtrusionCut
46 .. autofunction:: model.addExtrusionFuse
48 Extrusion Boolean object
49 ........................
51 .. autoclass:: model.features.extrusion_boolean.ExtrusionBoolean
54 Create an Extrusion Sketch
55 --------------------------
57 .. autofunction:: model.addExtrusionSketch
59 Extrusion Sketch object
60 .......................
62 .. autoclass:: model.features.extrusion_sketch.ExtrusionSketch