Part Wedge: Difference between revisions

From FreeCAD Documentation
mNo edit summary
(Marked this version for translation)
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
{{UnfinishedDocu{{#translation:}}}} <!-- missing docnav -->
<translate>
<translate>


Line 16: Line 15:
{{GuiCommand
{{GuiCommand
|Name=Part Wedge
|Name=Part Wedge
|MenuLocation=Part → Create primitives → Wedge
|MenuLocation=Part → [[Part_Primitives|Create primitives]] → Wedge
|Workbenches=[[Part_Workbench|Part]]
|Workbenches=[[Part_Workbench|Part]], [[OpenSCAD_Workbench|OpenSCAD]]
|SeeAlso=[[Part_Primitives|Part Primitives]]
|SeeAlso=[[Part_Primitives|Part Primitives]]
}}
}}
Line 24: Line 23:


<!--T:2-->
<!--T:2-->
A [[Image:Part_Wedge.svg|24px]] '''Part Wedge''' is a parametric solid that can be created with the [[Image:Part_Primitives.svg|24px]] [[Part_Primitives|Part Primitives]] command. It has four to six planar faces. It is defined by virtual front and rear main planes on which a rectangular face (the default), a single straight edge or a single vertex is created. These base shapes define the four quadrilateral or triangular faces that connect them. The resulting solid is only a true wedge if one of the base shapes is a rectangular face and the other a straight edge. In the coordinate system defined by its {{PropertyData|Placement}} property, the virtual front and rear main planes of the wedge are plane-parallel to XZ plane, and the edges of the base shapes are parallel to the X or Z axis. All its coordinates are relative to that coordinate system.
The [[Image:Part_Wedge.svg|24px]] [[Part_Wedge|Part Wedge]] command creates a parametric wedge solid.


</translate>
FreeCAD creates a wedge, with a larger front square and a smaller back square.
[[Image:Part_Wedge_Example.png|400px]]

<translate>
By default, the wedge is positioned with the lower left corner at the origin (0,0,0). The front square of the wedge is on the xz-plane. Its extension in x, y and z direction follows the positive axis values.

[[File:Part Wedge Example.png|Screenshot of a Part Wedge solid with default values]]


==Usage== <!--T:12-->
==Usage== <!--T:12-->


<!--T:15-->
# There are several ways to invoke the command:
#* Press the {{Button|[[Image:Part_Primitives.svg|16px]] [[Part Primitives|Create Primitives...]]}} button.
See [[Part_Primitives#Usage|Part Primitives]].
#* Select the {{MenuCommand|Part → Create Primitives → [[Image:Part_Primitives.svg|16px]] Create Primitives...}} option from the menu.
#* Select the {{MenuCommand|[[Image:Part_Wedge.svg|16px]] Wedge}} option from the menu.
# Set options and press {{Button|Create}}.
# To close the dialog press {{Button|Close}}.


== Example ==
== Example == <!--T:16-->


<!--T:17-->
[[File:Part Wedge Scripting Example.png|thumb|Part Wedge scripting example]]
[[Image:Part_Wedge_Scripting_Example.png|thumb|Part Wedge from the scripting example]]


<!--T:18-->
A Part Wedge object with the values of the bottom scripting example are shown here.
A Part Wedge object created with the [[#Scripting|scripting example]] below is shown here.


== Notes == <!--T:19-->


<!--T:20-->
=== Default Size and Placement === <!--T:3-->
* The values of the coordinates of the wedge must be such that a valid solid can be create. This means that the front and rear base shapes can both be single edges, but not if they are parallel. And if one of the base shapes is a vertex the other shape must be a rectangular face.


<!--T:4-->
== Properties == <!--T:21-->
'''Placement:'''
The default orientation places the base in the XZ plane and the top outward in the Y axis direction. The default base corner is the 0,0,0 origin.


<!--T:5-->
<!--T:22-->
See also: [[Property_editor|Property editor]].
'''Base Face:'''
*X : 10 mm
*Z : 10 mm


<!--T:6-->
<!--T:23-->
A Part Wedge object is derived from a [[Part_Feature|Part Feature]] object and inherits all its properties. It also has the following additional properties:
'''Height:'''
*Y : 0-10 mm


<!--T:7-->
=== Data === <!--T:24-->
'''Top Face:'''
*X : 2-8 mm
*Z : 2-8 mm


<!--T:25-->
{{TitleProperty|Attachment}}


<!--T:8-->
<!--T:26-->
The object has the same attachment properties as a [[Part_Part2DObject#Data|Part Part2DObject]].
[[File:PartWedgeProperty.png|left]]
{{clear}}


=== Parametric Inputs === <!--T:9-->
<!--T:27-->
{{TitleProperty|Wedge}}
{|
| [[File:PartWedgeProperty_Inputs.png]]
|
Using the default placement, the below inputs are:
*{{PropertyData|X min/max}} : Base face X axis span
*{{PropertyData|Y min/max}}: Wedge height span
*{{PropertyData|Z min/max}} : Base face Z axis span
*{{PropertyData|X2 min/max}} : Top face X axis span
*{{PropertyData|Z2 min/max}} : Top face Z axis span
|}


=== More examples for wedges === <!--T:10-->
<!--T:28-->
* {{PropertyData|Xmin|Distance}}: The lowest X coordinate of the front face of the wedge. The default is {{Value|0mm}}.
[[File:Wedge_examples.png]]
* {{PropertyData|Ymin|Distance}}: The Y coordinate of the front face of the wedge. The default is {{Value|0mm}}.
* {{PropertyData|Zmin|Distance}}: The lowest Z coordinate of the front face of the wedge. The default is {{Value|0mm}}.
* {{PropertyData|X2min|Distance}}: The lowest X coordinate of the rear face of the wedge. The default is {{Value|2mm}}.
* {{PropertyData|Z2min|Distance}}: The lowest Z coordinate of the rear face of the wedge. The default is {{Value|2mm}}.
* {{PropertyData|Xmax|Distance}}: The highest X coordinate of the front face of the wedge. The default is {{Value|10mm}}.
* {{PropertyData|Ymax|Distance}}: The Y coordinate of the rear face of the wedge. The default is {{Value|10mm}}.
* {{PropertyData|Zmax|Distance}}: The highest Z coordinate of the front face of the wedge. The default is {{Value|10mm}}.
* {{PropertyData|X2max|Distance}}: The highest X coordinate of the rear face of the wedge. The default is {{Value|8mm}}.
* {{PropertyData|Z2max|Distance}}: The highest Z coordinate of the rear face of the wedge. The default is {{Value|8mm}}.


== Properties ==
== Scripting == <!--T:29-->


<!--T:30-->
See also: [[Property_editor|Property editor]].
See also: [https://freecad.github.io/SourceDoc/ Autogenerated API documentation], [[Part_scripting|Part scripting]] and [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]].

A Part Wedge object is derived from a [[Part_Feature|Part Feature]] object and inherits all its properties. It also has the following additional properties:

=== Data ===

{{TitleProperty|Wedge}}

*{{PropertyData|Xmin|Length}}: Base face X minimum value
*{{PropertyData|Ymin|Length}}: Wedge height minimum value
*{{PropertyData|Zmin|Length}}: Base face Z minimum value
*{{PropertyData|X2min|Length}}: Top face X minimum value
*{{PropertyData|Z2min|Length}}: Top face Z minimum value
*{{PropertyData|Xmax|Length}}: Base face X maximum value
*{{PropertyData|Ymax|Length}}: Wedge height maximum value
*{{PropertyData|Zmax|Length}}: Base face Z maximum value
*{{PropertyData|X2max|Length}}: Top face X maximum value
*{{PropertyData|Z2max|Length}}: Top face Z maximum value

== Scripting ==


<!--T:31-->
A Part Wedge is created with the {{Incode|addObject()}} method of the document.
A Part Wedge can be created with the {{Incode|addObject()}} method of the document:


</translate>
</translate>
Line 119: Line 92:
<translate>
<translate>


<!--T:32-->
* Where {{Incode|myWedge}} is the name for the object. The name must be unique for the entire document.
* Where {{Incode|"myWedge"}} is the name for the object.
* The function returns the newly created object.
* The function returns the newly created object.


<!--T:33-->
The {{Incode|Label}} is the user editable name for the object. It can be easily changed by
Example:


</translate>
</translate>
{{Code|code=
{{Code|code=
import FreeCAD as App
wedge.Label = "new myWedgeName"
}}
<translate>


doc = App.activeDocument()
You can access and modify attributes of the {{Incode|wedge}} object. For example, you may wish to modify the minimum or maximum coordinate parameters.


wedge = doc.addObject("Part::Wedge", "myWedge")
</translate>
{{Code|code=
wedge.Xmin = 1
wedge.Xmin = 1
wedge.Ymin = 2
wedge.Ymin = 2
Line 144: Line 116:
wedge.X2max = 10
wedge.X2max = 10
wedge.Z2max = 12
wedge.Z2max = 12
wedge.Placement = App.Placement(App.Vector(1, 2, 3), App.Rotation(75, 60, 30))

doc.recompute()
}}
}}
<translate>
<translate>


You can change its placement and orientation with:

</translate>
{{Code|code=
wedge.Placement = FreeCAD.Placement(FreeCAD.Vector(1, 2, 3), FreeCAD.Rotation(75, 60, 30))
}}
<translate>


<!--T:14-->
<!--T:14-->
Line 166: Line 134:


</translate>
</translate>
{{Part Tools navi{{#translation:}}}}
{{Part_Tools_navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}

Latest revision as of 10:14, 3 March 2022

Part Wedge

Menu location
Part → Create primitives → Wedge
Workbenches
Part, OpenSCAD
Default shortcut
None
Introduced in version
-
See also
Part Primitives

Description

A Part Wedge is a parametric solid that can be created with the Part Primitives command. It has four to six planar faces. It is defined by virtual front and rear main planes on which a rectangular face (the default), a single straight edge or a single vertex is created. These base shapes define the four quadrilateral or triangular faces that connect them. The resulting solid is only a true wedge if one of the base shapes is a rectangular face and the other a straight edge. In the coordinate system defined by its DataPlacement property, the virtual front and rear main planes of the wedge are plane-parallel to XZ plane, and the edges of the base shapes are parallel to the X or Z axis. All its coordinates are relative to that coordinate system.

Usage

See Part Primitives.

Example

Part Wedge from the scripting example

A Part Wedge object created with the scripting example below is shown here.

Notes

  • The values of the coordinates of the wedge must be such that a valid solid can be create. This means that the front and rear base shapes can both be single edges, but not if they are parallel. And if one of the base shapes is a vertex the other shape must be a rectangular face.

Properties

See also: Property editor.

A Part Wedge object is derived from a Part Feature object and inherits all its properties. It also has the following additional properties:

Data

Attachment

The object has the same attachment properties as a Part Part2DObject.

Wedge

  • DataXmin (Distance): The lowest X coordinate of the front face of the wedge. The default is 0mm.
  • DataYmin (Distance): The Y coordinate of the front face of the wedge. The default is 0mm.
  • DataZmin (Distance): The lowest Z coordinate of the front face of the wedge. The default is 0mm.
  • DataX2min (Distance): The lowest X coordinate of the rear face of the wedge. The default is 2mm.
  • DataZ2min (Distance): The lowest Z coordinate of the rear face of the wedge. The default is 2mm.
  • DataXmax (Distance): The highest X coordinate of the front face of the wedge. The default is 10mm.
  • DataYmax (Distance): The Y coordinate of the rear face of the wedge. The default is 10mm.
  • DataZmax (Distance): The highest Z coordinate of the front face of the wedge. The default is 10mm.
  • DataX2max (Distance): The highest X coordinate of the rear face of the wedge. The default is 8mm.
  • DataZ2max (Distance): The highest Z coordinate of the rear face of the wedge. The default is 8mm.

Scripting

See also: Autogenerated API documentation, Part scripting and FreeCAD Scripting Basics.

A Part Wedge can be created with the addObject() method of the document:

wedge = FreeCAD.ActiveDocument.addObject("Part::Wedge", "myWedge")
  • Where "myWedge" is the name for the object.
  • The function returns the newly created object.

Example:

import FreeCAD as App

doc = App.activeDocument()

wedge = doc.addObject("Part::Wedge", "myWedge")
wedge.Xmin = 1
wedge.Ymin = 2
wedge.Zmin = 3
wedge.X2min = 4
wedge.Z2min = 6
wedge.Xmax = 15
wedge.Ymax = 20
wedge.Zmax = 55
wedge.X2max = 10
wedge.Z2max = 12
wedge.Placement = App.Placement(App.Vector(1, 2, 3), App.Rotation(75, 60, 30))

doc.recompute()