Draft Point/es: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
Line 1: Line 1:
<languages/>
<languages/>

{{Docnav
{{Docnav
|[[Draft_BSpline|BSpline]]
|[[Draft_BezCurve|BezCurve]]
|[[Draft_Facebinder|Facebinder]]
|[[Draft_ShapeString|ShapeString]]
|[[Draft_Module|Draft]]
|[[Draft_Module|Draft]]
|IconL=Draft_BSpline.svg
|IconL=Draft_BezCurve.svg
|IconR=Draft_ShapeString.svg
|IconR=Draft_Facebinder.svg
|IconC=Workbench_Draft.svg
|IconC=Workbench_Draft.svg
}}
}}
Line 20: Line 21:


[[Image:Draft_point_example.jpg|400px]]
[[Image:Draft_point_example.jpg|400px]]
<div class="mw-translate-fuzzy">
[[Image:Draft_point_example.jpg|400px]]
</div>


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
==Utilización==
==Utilización==
</div>
</div>

See also: [[Draft_Tray|Draft Tray]], [[Draft_Snap|Draft Snap]] and [[Draft_Constrain|Draft Constrain]].


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
Line 34: Line 34:


==Opciones==
==Opciones==

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.


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
Line 41: Line 43:


==Propiedades==
==Propiedades==

See also: [[property_editor|Property editor]].

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

===Data===

{{TitleProperty|Draft}}


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
Line 47: Line 57:
* {{PropertyData|Z}}: La coordenada Z del punto
* {{PropertyData|Z}}: La coordenada Z del punto
</div>
</div>

===View===

{{TitleProperty|Draft}}

* {{PropertyView|Pattern|Enumeration}}: not used.
* {{PropertyView|Pattern Size|Float}}: not used.

==Scripting==


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
Line 55: Line 74:
La herramienta punto se puede utilizar en [[macros/es|macros]] y desde la consola Python utilizando la siguiente función:
La herramienta punto se puede utilizar en [[macros/es|macros]] y desde la consola Python utilizando la siguiente función:
</div>
</div>

{{Code|code=
{{Code|code=
Point = makePoint(X=0, Y=0, Z=0, color=None, name="Point", point_size=5)
point = make_point(X=0, Y=0, Z=0, color=None, name="Point", point_size=5)
Point = makePoint(point, Y=0, Z=0, color=None, name="Point", point_size=5)
point = make_point(point, Y=0, Z=0, color=None, name="Point", point_size=5)
}}
}}


Line 65: Line 85:


Example:
Example:

{{Code|code=
{{Code|code=
import FreeCAD
import FreeCAD as App
import Draft
import Draft


Point1 = Draft.makePoint(1600, 1400, 0)
point1 = Draft.make_point(1600, 1400, 0)


p2 = FreeCAD.Vector(-3200, 1800, 0)
p2 = App.Vector(-3200, 1800, 0)
Point2 = Draft.makePoint(p2, color=(0.5, 0.3, 0.6), point_size=10)
point2 = Draft.make_point(p2, color=(0.5, 0.3, 0.6), point_size=10)

FreeCAD.ActiveDocument.recompute()
App.ActiveDocument.recompute()
}}
}}

Example:
Example:


This code creates {{incode|N}} random points within a square of side {{incode|2L}}. It makes a loop creating {{incode|N}} points, that may appear anywhere from {{incode|-L}} to {{incode|+L}} on both X and Y; it also chooses a random color and size for each point. Change {{incode|N}} to change the number of points, and change {{incode|L}} to change the area covered by the points.
This code creates {{incode|N}} random points within a square of side {{incode|2L}}. It makes a loop creating {{incode|N}} points, that may appear anywhere from {{incode|-L}} to {{incode|+L}} on both X and Y. It also chooses a random color and size for each point. Change {{incode|N}} to change the number of points, and change {{incode|L}} to change the area covered by the points.


{{Code|code=
{{Code|code=
import random
import random
import FreeCAD
import FreeCAD as App
import Draft
import Draft


L = 1000
L = 1000
centered = FreeCAD.Placement(FreeCAD.Vector(-L, -L, 0), FreeCAD.Rotation())
centered = App.Placement(App.Vector(-L, -L, 0), App.Rotation())
Rectangle = Draft.makeRectangle(2*L, 2*L, placement=centered)
rectangle = Draft.make_rectangle(2*L, 2*L, placement=centered)
N = 10


N = 10
for i in range(N):
for i in range(N):
x = 2*L*random.random() - L
x = 2*L*random.random() - L
Line 97: Line 120:
b = random.random()
b = random.random()
size = 15*random.random() + 5
size = 15*random.random() + 5
Draft.makePoint(x, y, z, color=(r, g, b), point_size=size)
Draft.make_point(x, y, z, color=(r, g, b), point_size=size)


FreeCAD.ActiveDocument.recompute()
App.ActiveDocument.recompute()
}}
}}



{{Docnav
{{Docnav
|[[Draft_BSpline|BSpline]]
|[[Draft_BezCurve|BezCurve]]
|[[Draft_Facebinder|Facebinder]]
|[[Draft_ShapeString|ShapeString]]
|[[Draft_Module|Draft]]
|[[Draft_Module|Draft]]
|IconL=Draft_BSpline.svg
|IconL=Draft_BezCurve.svg
|IconR=Draft_ShapeString.svg
|IconR=Draft_Facebinder.svg
|IconC=Workbench_Draft.svg
|IconC=Workbench_Draft.svg
}}
}}
Line 113: Line 137:
{{Draft Tools navi{{#translation:}}}}
{{Draft Tools navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{clear}}

Revision as of 11:21, 4 May 2021

Draft Point

Ubicación en el Menú
Boceto → Punto
Entornos de trabajo
Boceto, Arquitectura
Atajo de teclado por defecto
P T
Introducido en versión
-
Ver también
Ninguno

Descripción

La herramienta punto crea un punto simple en el plano de trabajo actual, útil para servir como referencia para ubicar otros objetos después. Toma el color previamente establecido en la pestaña de tareas.

Utilización

See also: Draft Tray, Draft Snap and Draft Constrain.

  1. Presiona el botón punto, o presiona las teclas P y T
  2. Designa un punto en la vista 3D, o escribe unas coordenadas coordenadas

Opciones

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

  • Para introducir coordenadas manualmente, simplemente introduce los números, y presiona ENTER entre cada componente X, Y y Z.
  • Presiona ESC o el botón Cancelar para evitar el comando actual.

Propiedades

See also: Property editor.

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

Data

Draft

  • DatosX: La coordenada X del punto
  • DatosY: La coordenada Y del punto
  • DatosZ: La coordenada Z del punto

View

Draft

  • VistaPattern (Enumeration): not used.
  • VistaPattern Size (Float): not used.

Scripting

Archivos de guión

La herramienta punto se puede utilizar en macros y desde la consola Python utilizando la siguiente función:

point = make_point(X=0, Y=0, Z=0, color=None, name="Point", point_size=5)
point = make_point(point, Y=0, Z=0, color=None, name="Point", point_size=5)
  • crea un punto en las coordenadas indicadas. Si no se indican las coordenadas X, Y y Z, el punto se creará en el origen de coordenadas (0,0,0). Devuelve el objeto recién creado.

Example:

import FreeCAD as App
import Draft

point1 = Draft.make_point(1600, 1400, 0)

p2 = App.Vector(-3200, 1800, 0)
point2 = Draft.make_point(p2, color=(0.5, 0.3, 0.6), point_size=10)

App.ActiveDocument.recompute()

Example:

This code creates N random points within a square of side 2L. It makes a loop creating N points, that may appear anywhere from -L to +L on both X and Y. It also chooses a random color and size for each point. Change N to change the number of points, and change L to change the area covered by the points.

import random
import FreeCAD as App
import Draft

L = 1000
centered = App.Placement(App.Vector(-L, -L, 0), App.Rotation())
rectangle = Draft.make_rectangle(2*L, 2*L, placement=centered)

N = 10
for i in range(N):
    x = 2*L*random.random() - L
    y = 2*L*random.random() - L
    z = 0
    r = random.random()
    g = random.random()
    b = random.random()
    size = 15*random.random() + 5
    Draft.make_point(x, y, z, color=(r, g, b), point_size=size)

App.ActiveDocument.recompute()