FreeCAD

Форк
0
/
Curve2dPy.xml 
154 строки · 6.8 Кб
1
<?xml version="1.0" encoding="UTF-8"?>
2
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
3
    <PythonExport
4
        Name="Curve2dPy"
5
        Namespace="Part"
6
        Twin="Geom2dCurve"
7
        TwinPointer="Geom2dCurve"
8
        PythonName="Part.Geom2d.Curve2d"
9
        FatherInclude="Mod/Part/App/Geom2d/Geometry2dPy.h"
10
        Include="Mod/Part/App/Geometry2d.h"
11
        Father="Geometry2dPy"
12
        FatherNamespace="Part"
13
        Constructor="true">
14
        <Documentation>
15
            <Author Licence="LGPL" Name="Werner Mayer" EMail="wmayer@users.sourceforge.net"/>
16
            <UserDocu>The abstract class Geom2dCurve is the root class of all curve objects.</UserDocu>
17
        </Documentation>
18
        <Methode Name="reverse">
19
            <Documentation>
20
                <UserDocu>Changes the direction of parametrization of the curve.</UserDocu>
21
            </Documentation>
22
        </Methode>
23
        <Methode Name="toShape" Const="true">
24
            <Documentation>
25
                <UserDocu>Return the shape for the geometry.</UserDocu>
26
            </Documentation>
27
        </Methode>
28
        <Methode Name="discretize" Const="true" Keyword="true">
29
            <Documentation>
30
                <UserDocu>Discretizes the curve and returns a list of points.
31
The function accepts keywords as argument:
32
discretize(Number=n) =&gt; gives a list of 'n' equidistant points
33
discretize(QuasiNumber=n) =&gt; gives a list of 'n' quasi equidistant points (is faster than the method above)
34
discretize(Distance=d) =&gt; gives a list of equidistant points with distance 'd'
35
discretize(Deflection=d) =&gt; gives a list of points with a maximum deflection 'd' to the curve
36
discretize(QuasiDeflection=d) =&gt; gives a list of points with a maximum deflection 'd' to the curve (faster)
37
discretize(Angular=a,Curvature=c,[Minimum=m]) =&gt; gives a list of points with an angular deflection of 'a'
38
                                    and a curvature deflection of 'c'. Optionally a minimum number of points
39
                                    can be set which by default is set to 2.
40

41
Optionally you can set the keywords 'First' and 'Last' to define a sub-range of the parameter range
42
of the curve.
43

44
If no keyword is given then it depends on whether the argument is an int or float.
45
If it's an int then the behaviour is as if using the keyword 'Number', if it's float
46
then the behaviour is as if using the keyword 'Distance'.
47

48
Example:
49

50
import Part
51
c=PartGeom2d.Circle2d()
52
c.Radius=5
53
p=c.discretize(Number=50,First=3.14)
54
s=Part.Compound([Part.Vertex(i) for i in p])
55
Part.show(s)
56

57

58
p=c.discretize(Angular=0.09,Curvature=0.01,Last=3.14,Minimum=100)
59
s=Part.Compound([Part.Vertex(i) for i in p])
60
Part.show(s)</UserDocu>
61
            </Documentation>
62
        </Methode>
63
        <Methode Name="length">
64
            <Documentation>
65
                <UserDocu>Computes the length of a curve
66
length([uMin,uMax,Tol]) -&gt; Float</UserDocu>
67
            </Documentation>
68
        </Methode>
69
        <Methode Name="parameterAtDistance">
70
            <Documentation>
71
                <UserDocu>Returns the parameter on the curve of a point at the given distance from a starting parameter.
72
parameterAtDistance([abscissa, startingParameter]) -&gt; Float the</UserDocu>
73
            </Documentation>
74
        </Methode>
75
        <Methode Name="value">
76
            <Documentation>
77
                <UserDocu>Computes the point of parameter u on this curve</UserDocu>
78
            </Documentation>
79
        </Methode>
80
        <Methode Name="tangent">
81
            <Documentation>
82
                <UserDocu>Computes the tangent of parameter u on this curve</UserDocu>
83
            </Documentation>
84
        </Methode>
85
        <Methode Name="parameter">
86
            <Documentation>
87
                <UserDocu>Returns the parameter on the curve
88
of the nearest orthogonal projection of the point.</UserDocu>
89
            </Documentation>
90
        </Methode>
91
        <Methode Name="normal" Const="true">
92
            <Documentation>
93
                <UserDocu>Vector = normal(pos) - Get the normal vector at the given parameter [First|Last] if defined</UserDocu>
94
            </Documentation>
95
        </Methode>
96
        <Methode Name="curvature" Const="true">
97
            <Documentation>
98
                <UserDocu>Float = curvature(pos) - Get the curvature at the given parameter [First|Last] if defined</UserDocu>
99
            </Documentation>
100
        </Methode>
101
        <Methode Name="centerOfCurvature" Const="true">
102
            <Documentation>
103
                <UserDocu>Vector = centerOfCurvature(float pos) - Get the center of curvature at the given parameter [First|Last] if defined</UserDocu>
104
            </Documentation>
105
        </Methode>
106
        <Methode Name="intersectCC" Const="true">
107
            <Documentation>
108
                <UserDocu>Returns all intersection points between this curve and the given curve.</UserDocu>
109
            </Documentation>
110
        </Methode>
111
        <Methode Name="toBSpline">
112
            <Documentation>
113
                <UserDocu>Converts a curve of any type (only part from First to Last)
114
                    toBSpline([Float=First, Float=Last]) -&gt; B-Spline curve</UserDocu>
115
            </Documentation>
116
        </Methode>
117
        <Methode Name="approximateBSpline">
118
            <Documentation>
119
                <UserDocu>Approximates a curve of any type to a B-Spline curve
120
                    approximateBSpline(Tolerance, MaxSegments, MaxDegree, [Order='C2']) -&gt; B-Spline curve</UserDocu>
121
            </Documentation>
122
        </Methode>
123
        <Attribute Name="Continuity" ReadOnly="true">
124
            <Documentation>
125
                <UserDocu>Returns the global continuity of the curve.</UserDocu>
126
            </Documentation>
127
            <Parameter Name="Continuity" Type="String"/>
128
        </Attribute>
129
        <Attribute Name="Closed" ReadOnly="true">
130
            <Documentation>
131
                <UserDocu>Returns true if the curve is closed.</UserDocu>
132
            </Documentation>
133
            <Parameter Name="Closed" Type="Boolean"/>
134
        </Attribute>
135
        <Attribute Name="Periodic" ReadOnly="true">
136
            <Documentation>
137
                <UserDocu>Returns true if the curve is periodic.</UserDocu>
138
            </Documentation>
139
            <Parameter Name="Periodic" Type="Boolean"/>
140
        </Attribute>
141
        <Attribute Name="FirstParameter" ReadOnly="true">
142
            <Documentation>
143
                <UserDocu>Returns the value of the first parameter.</UserDocu>
144
            </Documentation>
145
            <Parameter Name="FirstParameter" Type="Float"/>
146
        </Attribute>
147
        <Attribute Name="LastParameter" ReadOnly="true">
148
            <Documentation>
149
                <UserDocu>Returns the value of the last parameter.</UserDocu>
150
            </Documentation>
151
            <Parameter Name="LastParameter" Type="Float"/>
152
        </Attribute>
153
    </PythonExport>
154
</GenerateModel>
155

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.