Skip to content

Latest commit

 

History

History
526 lines (215 loc) · 12.5 KB

File metadata and controls

526 lines (215 loc) · 12.5 KB

Ellipse API

Describes an ellipse in 3D space To create an ellipse there are several ways: Part.Ellipse() Creates an ellipse with major radius 2 and minor radius 1 with the center in (0,0,0)

			Part.Ellipse(Ellipse)
				Create a copy of the given ellipse

			Part.Ellipse(S1,S2,Center)
				Creates an ellipse centered on the point Center, where
				the plane of the ellipse is defined by Center, S1 and S2,
				its major axis is defined by Center and S1,
				its major radius is the distance between Center and S1, and
				its minor radius is the distance between S2 and the major axis.

			Part.Ellipse(Center,MajorRadius,MinorRadius)
				Creates an ellipse with major and minor radii MajorRadius and
				MinorRadius, and located in the plane defined by Center and
				the normal (0,0,1)

AngleXU

The angle between the X axis and the major axis of the conic.

Axis

The axis direction of the circle

Center

Deprecated -- use Location.

Content

Content of the object in XML representation.

Continuity

Returns the global continuity of the curve.

Eccentricity

returns the eccentricity value of the conic e. e = 0 for a circle 0 < e < 1 for an ellipse (e = 0 if MajorRadius = MinorRadius) e > 1 for a hyperbola e = 1 for a parabola

FirstParameter

Returns the value of the first parameter.

Focal

The focal distance of the ellipse.

Focus1

The first focus is on the positive side of the major axis of the ellipse; the second focus is on the negative side.

Focus2

LastParameter

Returns the value of the last parameter.

Location

Location of the conic.

MajorRadius

The major radius of the ellipse.

MemSize

Memory size of the object in bytes.

MinorRadius

The minor radius of the ellipse.

Module

Module in which this class is defined

Rotation

Returns a rotation object to describe the orientation for curve that supports it

Tag

Gives the tag of the geometry as string.

TypeId

Is the type of the FreeCAD object with module domain

XAxis

The X axis direction of the circle

YAxis

The Y axis direction of the circle

approximateBSpline

Approximates a curve of any type to a B-Spline curve approximateBSpline(Tolerance, MaxSegments, MaxDegree, [Order='C2']) -> B-Spline curve

centerOfCurvature

Vector = centerOfCurvature(float pos) - Get the center of curvature at the given parameter [First|Last] if defined

clone

Create a clone of this geometry with the same Tag

continuityWith

Computes the continuity of two curves

copy

Create a copy of this geometry

curvature

Float = curvature(pos) - Get the curvature at the given parameter [First|Last] if defined

deleteExtensionOfName

Deletes all extensions of the indicated name.

deleteExtensionOfType

Deletes all extensions of the indicated type.

discretize

Discretizes the curve and returns a list of points. The function accepts keywords as argument: discretize(Number=n) => gives a list of 'n' equidistant points discretize(QuasiNumber=n) => gives a list of 'n' quasi equidistant points (is faster than the method above) discretize(Distance=d) => gives a list of equidistant points with distance 'd' discretize(Deflection=d) => gives a list of points with a maximum deflection 'd' to the curve discretize(QuasiDeflection=d) => gives a list of points with a maximum deflection 'd' to the curve (faster) discretize(Angular=a,Curvature=c,[Minimum=m]) => gives a list of points with an angular deflection of 'a' and a curvature deflection of 'c'. Optionally a minimum number of points can be set which by default is set to 2.

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

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

Example:

import Part c=Part.Circle() c.Radius=5 p=c.discretize(Number=50,First=3.14) s=Part.Compound([Part.Vertex(i) for i in p]) Part.show(s)

p=c.discretize(Angular=0.09,Curvature=0.01,Last=3.14,Minimum=100) s=Part.Compound([Part.Vertex(i) for i in p]) Part.show(s)

dumpContent

dumpContent(Compression=3) -> bytearray

Dumps the content of the object, both the XML representation and the additional data files required, into a byte representation.

Compression : int Set the data compression level in the range [0,9]. Set to 0 for no compression.

getAllDerivedFrom

Returns all descendants

getD0

Returns the point of given parameter

getD1

Returns the point and first derivative of given parameter

getD2

Returns the point, first and second derivatives

getD3

Returns the point, first, second and third derivatives

getDN

Returns the n-th derivative

getExtensionOfName

Gets the first geometry extension of the name indicated by the string.

getExtensionOfType

Gets the first geometry extension of the type indicated by the string.

getExtensions

Returns a list with information about the geometry extensions.

hasExtensionOfName

Returns a boolean indicating whether a geometry extension with the name indicated as a string exists.

hasExtensionOfType

Returns a boolean indicating whether a geometry extension of the type indicated as a string exists.

intersect

Returns all intersection points and curve segments between the curve and the curve/surface.

			  arguments: curve/surface (for the intersection), precision (float)

intersect2d

Get intersection points with another curve lying on a plane.

intersectCC

Returns all intersection points between this curve and the given curve.

intersectCS

Returns all intersection points and curve segments between the curve and the surface.

isClosed

Returns true if the curve is closed.

isDerivedFrom

Returns true if given type is a father

isPeriodic

Returns true if this curve is periodic.

length

Computes the length of a curve length([uMin,uMax,Tol]) -> Float

makeRuledSurface

Make a ruled surface of this and the given curves

mirror

Performs the symmetrical transformation of this geometric object

normal

Vector = normal(pos) - Get the normal vector at the given parameter [First|Last] if defined

parameter

Returns the parameter on the curve of the nearest orthogonal projection of the point.

parameterAtDistance

Returns the parameter on the curve of a point at the given distance from a starting parameter. parameterAtDistance([abscissa, startingParameter]) -> Float the

period

Returns the period of this curve or raises an exception if it is not periodic.

projectPoint

Computes the projection of a point on the curve

projectPoint(Point=Vector,[Method="NearestPoint"]) projectPoint(Vector,"NearestPoint") -> Vector projectPoint(Vector,"LowerDistance") -> float projectPoint(Vector,"LowerDistanceParameter") -> float projectPoint(Vector,"Distance") -> list of floats projectPoint(Vector,"Parameter") -> list of floats projectPoint(Vector,"Point") -> list of points

restoreContent

restoreContent(obj) -> None

Restore the content of the object from a byte representation as stored by dumpContent. It could be restored from any Python object implementing the buffer protocol.

obj : buffer Object with buffer protocol support.

reverse

Changes the direction of parametrization of the curve.

reversedParameter

Returns the parameter on the reversed curve for the point of parameter U on this curve.

rotate

Rotates this geometric object at angle Ang (in radians) about axis

scale

Applies a scaling transformation on this geometric object with a center and scaling factor

setExtension

Sets a geometry extension of the indicated type.

tangent

Computes the tangent of parameter u on this curve

toBSpline

Converts a curve of any type (only part from First to Last) toBSpline([Float=First, Float=Last]) -> B-Spline curve

toNurbs

Converts a curve of any type (only part from First to Last) toNurbs([Float=First, Float=Last]) -> NURBS curve

toShape

Return the shape for the geometry.

transform

Applies a transformation to this geometric object

translate

Translates this geometric object

trim

Returns a trimmed curve defined in the given parameter range trim([Float=First, Float=Last]) -> trimmed curve

value

Computes the point of parameter u on this curve


documentation index > API > Ellipse API