Draft Trimex: Difference between revisions

From FreeCAD Documentation
m (Docnav)
mNo edit summary
 
(65 intermediate revisions by 7 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
<translate>
<translate>

<!--T:16-->
<!--T:16-->
{{Docnav
{{Docnav|[[Draft_Offset|Offset]]|[[Draft_Join|Join]]|[[Draft_Module|Draft]]|IconL=Draft_Offset.svg|IconC=Workbench_Draft.svg|IconR=Draft_Join.svg}}
|[[Draft_Offset|Offset]]
|[[Draft_Stretch|Stretch]]
|[[Draft_Workbench|Draft]]
|IconL=Draft_Offset.svg
|IconR=Draft_Stretch.svg
|IconC=Workbench_Draft.svg
}}


<!--T:1-->
<!--T:1-->
{{GuiCommand
{{GuiCommand
|Name=Draft Trimex
|Name=Draft Trimex
|MenuLocation=DraftTrim/Extend
|MenuLocation=ModificationTrimex
|Workbenches=[[Draft Module|Draft]], [[Arch Module|Arch]]
|Workbenches=[[Draft_Workbench|Draft]], [[Arch_Workbench|Arch]]
|Shortcut=T R
|Shortcut={{KEY|T}} {{KEY|R}}
|SeeAlso=[[Part Extrude|Part Extrude]]
|SeeAlso=[[Part_Extrude|Part Extrude]]
}}
}}


Line 16: Line 24:


<!--T:3-->
<!--T:3-->
The [[Image:Draft_Trimex.svg|24px]] '''Draft Trimex''' command [[#Trim_or_extend|trims or extends]] a selected object. Intersections with the edge of another object can be used to determine new endpoints. The command can also be used to [[#Extrude|extrude]] a face, in which case it creates a [[Part_Extrude|Part Extrude]] object.
The Trimex tool trims or extends [[Draft Line]]s and [[Draft Wire]]s so that they end at an intersection with another line or edge.

<!--T:10-->
The Trimex tool also extrudes faces created from closed wires. In this sense, it's similar to [[Part Extrude]] and to [[PartDesign Pad]].


</translate>
</translate>
Line 25: Line 30:
<translate>
<translate>
<!--T:11-->
<!--T:11-->
{{Caption|Wire segment extended, then wire segment trimmed; face extruded into a solid body}}
{{Caption|Top: a Draft Wire extended and then trimmed.<br>
Bottom: a face extruded into a solid body.}}


==How to use== <!--T:4-->
==Trim or extend== <!--T:20-->

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


<!--T:5-->
<!--T:5-->
# Optionally select one object. The object must be a [[Draft_Line|Draft Line]], a [[Draft_Wire|Draft Wire]], a [[Draft_Arc|Draft Arc]] or a [[Draft_Circle|Draft Circle]] (which can only be trimmed). If the selected object is closed it must have its {{PropertyData|Make Face}} property set to {{FALSE}}.
# Select a line that you wish to trim or extend, or select a face that you wish to extrude.
# There are several ways to invoke the command:
# Press the {{Button|[[Image:Draft Trimex.svg|16px]] [[Draft Trimex]]}} button, or press {{KEY|T}} then {{KEY|R}} keys.
#* Press the {{Button|[[Image:Draft_Trimex.svg|16px]] [[Draft_Trimex|Trimex]]}} button.
# Click a point in the 3D view, or enter a distance and press {{KEY|Enter}}.
#* Select the {{MenuCommand|Modification → [[Image:Draft_Trimex.svg|16px]] Trimex}} option from the menu.
#* Use the keyboard shortcut: {{KEY|T}} then {{KEY|R}}.
# If you have not yet selected an object: select an object in the [[3D_view|3D view]].
# The {{MenuCommand|Trimex}} task panel opens. See [[#Options|Options]] for more information.
# Move the pointer in the [[3D_view|3D view]] so that the preview matches the desired result. If required use the modifier keys as explained in the [[#Options|Options]].
# Do one of the following:
#* Pick a point in the [[3D_view|3D view]].
#* Enter a {{MenuCommand|Distance}} or an {{MenuCommand|Angle}}. The distance is a delta distance. This option does not work if modifier keys are used.
#* Move the pointer over an edge belonging to another object, and click when this edge is highlighted, to trim or extend the selected object using an intersection with the highlighted edge as the new endpoint. When trimming, the projection of the point where the cutting edge is selected onto the object to be trimmed, determines the default result. Note that [[Draft_Snap|Draft Snaps]] can have an undesirable impact here. In some cases it can be useful to turn them off temporarily.


<!--T:12-->
===Options=== <!--T:22-->
Trimming or extending is decided from the position of the pointer.
* If the line is short it can be extended to approach and cross another line.
* If the line is long and crosses another line, the excess length can be trimmed.
* If the pointer is moved over another object or edge, the trim-extend operation will snap to that object, so that the trimmed or extended line ends exactly at the intersection with the object. This snapping works even without [[Draft Snap]] modes active.


<!--T:13-->
<!--T:23-->
The single character keyboard shortcuts available in the task panel can be changed. See [[Draft_Preferences|Draft Preferences]]. The shortcuts mentioned here are the default shortcuts.
A [[Draft Wire]] allows you to trim or extend any of its individual segments, which may affect the entire shape of the wire. In this case, the Trimex tool will work on the line segment that is closer to the pointer. Hold the {{KEY|Shift}} key to keep trimming or extending the current segment independently of the position of the pointer.


<!--T:14-->
<!--T:24-->
* Hold down {{KEY|Alt}} to invert the default result of the command.
When the selected object is a face, the Trimex tool switches to {{Emphasis|extrude}} mode. In extrude mode the extrusion is done in the direction of the normal of the face. For example, if a rectangle lies on the XY plane, it should be extruded in the Z direction. To do this correctly, pressing the {{KEY|Z}} key may be necessary to constrain the distance to the Z direction. Alternatively, hold the {{KEY|Shift}} key to extrude in any direction that is not the normal.
* Hold down {{KEY|Shift}} to restrict the operation to the current segment of a [[Draft_Wire|Draft Wire]].
* Press {{KEY|S}} to switch [[Draft_Snap|Draft snapping]] on or off.


==Options== <!--T:6-->
<!--T:25-->
Here is an example to explain the modifier keys. The left edge or the bottom edge of the U-shaped wire was extended. All [[Draft_Snap|Draft Snaps]] were turned off.

</translate>
[[Image:Draft_Trimex_example2.png]]
<translate>


<!--T:7-->
<!--T:7-->
# The arc was clicked near the bottom left corner of the wire. This is the default result.
* Press {{KEY|X}}, {{KEY|Y}} or {{KEY|Z}} to constrain the point on the given axis.
* Hold {{KEY|Shift}} to restrict the operation to the current segment, and avoid picking another one.
# {{KEY|Alt}} was held down while the arc was clicked near the bottom left corner of the wire.
# {{KEY|Y}} was pressed, and while hovering over the left edge {{KEY|Shift}} was held down and then the arc was clicked. Pressing {{KEY|Y}} is only required for edges that are more or less parallel to the Y axis.
** In the case of extrude mode, hold {{KEY|Shift}} to extrude a face in a direction that is not the normal.

* Hold {{KEY|Alt}} while trimming to invert the direction of the operation, that is, the other end of the wire will be cut.
==Extrude== <!--T:26-->

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

<!--T:28-->
See also: [[Draft_Snap|Draft Snap]] and [[Draft_Constrain|Draft Constrain]].

<!--T:29-->
# It can be helpful to first change the [[Draft_SelectPlane|Draft working plane]] so that it is not coplanar with the face you want to extrude.
# Optionally select a single face or an object with a single face.
# There are several ways to invoke the command:
#* Press the {{Button|[[Image:Draft_Trimex.svg|16px]] [[Draft_Trimex|Draft Trimex]]}} button.
#* Select the {{MenuCommand|Modification → [[Image:Draft_Trimex.svg|16px]] Trimex}} option from the menu.
#* Use the keyboard shortcut: {{KEY|T}} then {{KEY|R}}.
# If you have not yet selected an object or a face: select an object with a single face in the [[3D_view|3D view]].
# The {{MenuCommand|Trimex}} task panel opens. See [[#Options_2|Options]] for more information.
# To define the extrusion direction and distance do one of the following:
#* Pick a point in the [[3D_view|3D view]] that does no lie on the same plane as the face.
#* Make sure the pointer is on the correct side of the face in the [[3D_view|3D view]] and enter a {{MenuCommand|Distance}}.

===Options=== <!--T:30-->

<!--T:31-->
The modifier key mentioned here can be changed. See [[Draft_Preferences|Draft Preferences]].

<!--T:32-->
* Hold {{KEY|Shift}} to extrude in a direction that is not parallel to the normal of the face.

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


==Scripting== <!--T:8-->
<!--T:8-->
{{Emphasis|See also:}} [[Draft API]] and [[FreeCAD Scripting Basics]].
See also: [https://freecad.github.io/SourceDoc/ Autogenerated API documentation] and [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]].


<!--T:9-->
<!--T:9-->
There is no Python method to trim objects. To extrude objects use the {{incode|extrude}} method of the Draft module.
There is no programming interface available for the Trimex tool. See the [[Part Extrude]] tool for extrusion of faces and other shapes.


</translate>
<!--T:15-->
{{Code|code=
{{Docnav|[[Draft_Offset|Offset]]|[[Draft_Join|Join]]|[[Draft_Module|Draft]]|IconL=Draft_Offset.svg|IconC=Workbench_Draft.svg|IconR=Draft_Join.svg}}
extrusion = extrude(obj, vector, solid=False)
}}
<translate>


<!--T:17-->
<!--T:36-->
* {{incode|obj}} is the object to be extruded.
{{Draft Tools navi}}
* {{incode|vector}} is the extrusion direction and distance.
* If {{incode|solid}} is {{incode|True}} a solid is created instead of a shell.
* {{incode|extrusion}} is returned with the created object.

<!--T:37-->
Example:

</translate>
{{Code|code=
import FreeCAD as App
import Draft

doc = App.newDocument()

rectangle = Draft.make_rectangle(1500, 500)
doc.recompute()

vector = App.Vector(0, 0, 300)
solid = Draft.extrude(rectangle, vector, solid=True)
doc.recompute()
}}
<translate>


<!--T:15-->
{{Docnav
|[[Draft_Offset|Offset]]
|[[Draft_Stretch|Stretch]]
|[[Draft_Workbench|Draft]]
|IconL=Draft_Offset.svg
|IconR=Draft_Stretch.svg
|IconC=Workbench_Draft.svg
}}


<!--T:18-->
{{Userdocnavi}}
</translate>
</translate>
{{Draft Tools navi{{#translation:}}}}
{{clear}}
{{Userdocnavi{{#translation:}}}}

Latest revision as of 18:41, 6 January 2024

Draft Trimex

Menu location
Modification → Trimex
Workbenches
Draft, Arch
Default shortcut
T R
Introduced in version
-
See also
Part Extrude

Description

The Draft Trimex command trims or extends a selected object. Intersections with the edge of another object can be used to determine new endpoints. The command can also be used to extrude a face, in which case it creates a Part Extrude object.

Top: a Draft Wire extended and then trimmed.
Bottom: a face extruded into a solid body.

Trim or extend

Usage

  1. Optionally select one object. The object must be a Draft Line, a Draft Wire, a Draft Arc or a Draft Circle (which can only be trimmed). If the selected object is closed it must have its DataMake Face property set to false.
  2. There are several ways to invoke the command:
    • Press the Trimex button.
    • Select the Modification → Trimex option from the menu.
    • Use the keyboard shortcut: T then R.
  3. If you have not yet selected an object: select an object in the 3D view.
  4. The Trimex task panel opens. See Options for more information.
  5. Move the pointer in the 3D view so that the preview matches the desired result. If required use the modifier keys as explained in the Options.
  6. Do one of the following:
    • Pick a point in the 3D view.
    • Enter a Distance or an Angle. The distance is a delta distance. This option does not work if modifier keys are used.
    • Move the pointer over an edge belonging to another object, and click when this edge is highlighted, to trim or extend the selected object using an intersection with the highlighted edge as the new endpoint. When trimming, the projection of the point where the cutting edge is selected onto the object to be trimmed, determines the default result. Note that Draft Snaps can have an undesirable impact here. In some cases it can be useful to turn them off temporarily.

Options

The single character keyboard shortcuts available in the task panel can be changed. See Draft Preferences. The shortcuts mentioned here are the default shortcuts.

  • Hold down Alt to invert the default result of the command.
  • Hold down Shift to restrict the operation to the current segment of a Draft Wire.
  • Press S to switch Draft snapping on or off.

Here is an example to explain the modifier keys. The left edge or the bottom edge of the U-shaped wire was extended. All Draft Snaps were turned off.

  1. The arc was clicked near the bottom left corner of the wire. This is the default result.
  2. Alt was held down while the arc was clicked near the bottom left corner of the wire.
  3. Y was pressed, and while hovering over the left edge Shift was held down and then the arc was clicked. Pressing Y is only required for edges that are more or less parallel to the Y axis.

Extrude

Usage

See also: Draft Snap and Draft Constrain.

  1. It can be helpful to first change the Draft working plane so that it is not coplanar with the face you want to extrude.
  2. Optionally select a single face or an object with a single face.
  3. There are several ways to invoke the command:
    • Press the Draft Trimex button.
    • Select the Modification → Trimex option from the menu.
    • Use the keyboard shortcut: T then R.
  4. If you have not yet selected an object or a face: select an object with a single face in the 3D view.
  5. The Trimex task panel opens. See Options for more information.
  6. To define the extrusion direction and distance do one of the following:
    • Pick a point in the 3D view that does no lie on the same plane as the face.
    • Make sure the pointer is on the correct side of the face in the 3D view and enter a Distance.

Options

The modifier key mentioned here can be changed. See Draft Preferences.

  • Hold Shift to extrude in a direction that is not parallel to the normal of the face.

Scripting

See also: Autogenerated API documentation and FreeCAD Scripting Basics.

There is no Python method to trim objects. To extrude objects use the extrude method of the Draft module.

extrusion = extrude(obj, vector, solid=False)
  • obj is the object to be extruded.
  • vector is the extrusion direction and distance.
  • If solid is True a solid is created instead of a shell.
  • extrusion is returned with the created object.

Example:

import FreeCAD as App
import Draft

doc = App.newDocument()

rectangle = Draft.make_rectangle(1500, 500)
doc.recompute()

vector = App.Vector(0, 0, 300)
solid = Draft.extrude(rectangle, vector, solid=True)
doc.recompute()