space_ex v0.1.0 SpaceEx.SpaceCenter.Part
Represents an individual part.
Vessels are made up of multiple parts.
Instances of this class can be obtained by several methods in SpaceEx.SpaceCenter.Parts
.
Link to this section Summary
Functions
Exert a constant force on the part, acting at the given position
The axis-aligned bounding box of the part in the given reference frame
The position of the parts center of mass in the given reference frame
The direction the part points in, in the given reference frame
A SpaceEx.SpaceCenter.Antenna
if the part is an antenna, otherwise nil
Whether the part is axially attached to its parent, i.e
A SpaceEx.SpaceCenter.CargoBay
if the part is a cargo bay, otherwise nil
The reference frame that is fixed relative to this part, and centered on its center of mass
The parts children
A SpaceEx.SpaceCenter.ControlSurface
if the part is an aerodynamic control surface,
otherwise nil
The cost of the part, in units of funds
Whether this part is crossfeed capable
The stage in which this part will be decoupled
A SpaceEx.SpaceCenter.Decoupler
if the part is a decoupler, otherwise nil
A SpaceEx.SpaceCenter.DockingPort
if the part is a docking port, otherwise nil
The mass of the part, not including any resources it contains, in kilograms
The dynamic pressure acting on the part, in Pascals
An SpaceEx.SpaceCenter.Engine
if the part is an engine, otherwise nil
An SpaceEx.SpaceCenter.Experiment
if the part is a science experiment, otherwise nil
A SpaceEx.SpaceCenter.Fairing
if the part is a fairing, otherwise nil
The parts that are connected to this part via fuel lines, where the direction of the fuel line is into this part
The parts that are connected to this part via fuel lines, where the direction of the fuel line is out of this part
The color used to highlight the part, as an RGB triple
Whether the part is highlighted
The impact tolerance of the part, in meters per second
The inertia tensor of the part in the parts reference frame
(SpaceEx.SpaceCenter.ReferenceFrame
)
An SpaceEx.SpaceCenter.Intake
if the part is an intake, otherwise nil
Whether this part is a fuel line
A SpaceEx.SpaceCenter.LaunchClamp
if the part is a launch clamp, otherwise nil
A SpaceEx.SpaceCenter.Leg
if the part is a landing leg, otherwise nil
A SpaceEx.SpaceCenter.Light
if the part is a light, otherwise nil
The current mass of the part, including resources it contains, in kilograms
Whether the part is massless
Maximum temperature that the skin of the part can survive, in Kelvin
Maximum temperature that the part can survive, in Kelvin
The modules for this part
The moment of inertia of the part in \(kg.m^2\) around its center of mass
in the parts reference frame (SpaceEx.SpaceCenter.ReferenceFrame
)
Internal name of the part, as used in part cfg files
A SpaceEx.SpaceCenter.Parachute
if the part is a parachute, otherwise nil
The parts parent
Whether the part is radially attached to its parent, i.e
A SpaceEx.SpaceCenter.Radiator
if the part is a radiator, otherwise nil
A SpaceEx.SpaceCenter.RCS
if the part is an RCS block/thruster, otherwise nil
A SpaceEx.SpaceCenter.ReactionWheel
if the part is a reaction wheel, otherwise nil
The reference frame that is fixed relative to this part, and centered on a fixed position within the part, defined by the parts model
A SpaceEx.SpaceCenter.ResourceConverter
if the part is a resource converter,
otherwise nil
A SpaceEx.SpaceCenter.ResourceHarvester
if the part is a resource harvester,
otherwise nil
A SpaceEx.SpaceCenter.Resources
object for the part
A SpaceEx.SpaceCenter.Sensor
if the part is a sensor, otherwise nil
Whether the part is shielded from the exterior of the vessel, for example by a fairing
Temperature of the skin of the part, in Kelvin
A SpaceEx.SpaceCenter.SolarPanel
if the part is a solar panel, otherwise nil
The stage in which this part will be activated
The name tag for the part
Temperature of the part, in Kelvin
The rate at which heat energy is conducting into or out of the part via contact with other parts
The rate at which heat energy is convecting into or out of the part from the surrounding atmosphere
The rate at which heat energy is begin generated by the part
A measure of how much energy it takes to increase the internal temperature of the part, in Joules per Kelvin
The rate at which heat energy is radiating into or out of the part from the surrounding environment
A measure of how much energy it takes to increase the temperature of the resources contained in the part, in Joules per Kelvin
A measure of how much energy it takes to increase the skin temperature of the part, in Joules per Kelvin
The rate at which heat energy is transferring between the part's skin and its internals
Title of the part, as shown when the part is right clicked in-game
The vessel that contains this part
A SpaceEx.SpaceCenter.Wheel
if the part is a wheel, otherwise nil
Exert an instantaneous force on the part, acting at the given position
The position of the part in the given reference frame
The rotation of the part, in the given reference frame
The color used to highlight the part, as an RGB triple
Whether the part is highlighted
The name tag for the part
The linear velocity of the part in the given reference frame
Link to this section Functions
Exert a constant force on the part, acting at the given position.
Returns: An object that can be used to remove or modify the force.
force
— A vector pointing in the direction that the force acts, with its magnitude equal to the strength of the force in Newtons.position
— The position at which the force acts, as a vector.referenceFrame
— The reference frame that the force and position are in.
The axis-aligned bounding box of the part in the given reference frame.
Returns: The positions of the minimum and maximum vertices of the box, as position vectors.
referenceFrame
— The reference frame that the returned position vectors are in.
This is computed from the collision mesh of the part.
If the part is not collidable, the box has zero volume and is centered on
the SpaceEx.SpaceCenter.Part.position/3
of the part.
The position of the parts center of mass in the given reference frame.
If the part is physicsless, this is equivalent to SpaceEx.SpaceCenter.Part.position/3
.
Returns: The position as a vector.
referenceFrame
— The reference frame that the returned position vector is in.
The direction the part points in, in the given reference frame.
Returns: The direction as a unit vector.
referenceFrame
— The reference frame that the returned direction is in.
A SpaceEx.SpaceCenter.Antenna
if the part is an antenna, otherwise nil
.
Whether the part is axially attached to its parent, i.e.
on the top
or bottom of its parent. If the part has no parent, returns false
.
A SpaceEx.SpaceCenter.CargoBay
if the part is a cargo bay, otherwise nil
.
The reference frame that is fixed relative to this part, and centered on its center of mass.
The origin is at the center of mass of the part, as returned by
SpaceEx.SpaceCenter.Part.center_of_mass/3
.The axes rotate with the part.
The x, y and z axis directions depend on the design of the part.
For docking port parts, this reference frame is not necessarily equivalent to the
reference frame for the docking port, returned by
SpaceEx.SpaceCenter.DockingPort.get_reference_frame/2
.
The parts children.
Returns an empty list if the part has no children.
This, in combination with SpaceEx.SpaceCenter.Part.get_parent/2
, can be used to traverse the vessels
parts tree.
A SpaceEx.SpaceCenter.ControlSurface
if the part is an aerodynamic control surface,
otherwise nil
.
The cost of the part, in units of funds.
Whether this part is crossfeed capable.
The stage in which this part will be decoupled.
Returns -1 if the part is never decoupled from the vessel.
A SpaceEx.SpaceCenter.Decoupler
if the part is a decoupler, otherwise nil
.
A SpaceEx.SpaceCenter.DockingPort
if the part is a docking port, otherwise nil
.
The mass of the part, not including any resources it contains, in kilograms.
Returns zero if the part is massless.
The dynamic pressure acting on the part, in Pascals.
An SpaceEx.SpaceCenter.Engine
if the part is an engine, otherwise nil
.
An SpaceEx.SpaceCenter.Experiment
if the part is a science experiment, otherwise nil
.
A SpaceEx.SpaceCenter.Fairing
if the part is a fairing, otherwise nil
.
The parts that are connected to this part via fuel lines, where the direction of the fuel line is into this part.
The parts that are connected to this part via fuel lines, where the direction of the fuel line is out of this part.
The color used to highlight the part, as an RGB triple.
Whether the part is highlighted.
The impact tolerance of the part, in meters per second.
The inertia tensor of the part in the parts reference frame
(SpaceEx.SpaceCenter.ReferenceFrame
).
Returns the 3x3 matrix as a list of elements, in row-major order.
An SpaceEx.SpaceCenter.Intake
if the part is an intake, otherwise nil
.
This includes any part that generates thrust. This covers many different types
of engine, including liquid fuel rockets, solid rocket boosters and jet engines.
For RCS thrusters see SpaceEx.SpaceCenter.RCS
.
Whether this part is a fuel line.
A SpaceEx.SpaceCenter.LaunchClamp
if the part is a launch clamp, otherwise nil
.
A SpaceEx.SpaceCenter.Leg
if the part is a landing leg, otherwise nil
.
A SpaceEx.SpaceCenter.Light
if the part is a light, otherwise nil
.
The current mass of the part, including resources it contains, in kilograms.
Returns zero if the part is massless.
Whether the part is massless.
Maximum temperature that the skin of the part can survive, in Kelvin.
Maximum temperature that the part can survive, in Kelvin.
The modules for this part.
The moment of inertia of the part in \(kg.m^2\) around its center of mass
in the parts reference frame (SpaceEx.SpaceCenter.ReferenceFrame
).
Internal name of the part, as used in part cfg files.
For example "Mark1-2Pod".
A SpaceEx.SpaceCenter.Parachute
if the part is a parachute, otherwise nil
.
The parts parent.
Returns nil
if the part does not have a parent.
This, in combination with SpaceEx.SpaceCenter.Part.get_children/2
, can be used to traverse the vessels
parts tree.
Whether the part is radially attached to its parent, i.e.
on the side of its parent.
If the part has no parent, returns false
.
A SpaceEx.SpaceCenter.Radiator
if the part is a radiator, otherwise nil
.
A SpaceEx.SpaceCenter.RCS
if the part is an RCS block/thruster, otherwise nil
.
A SpaceEx.SpaceCenter.ReactionWheel
if the part is a reaction wheel, otherwise nil
.
The reference frame that is fixed relative to this part, and centered on a fixed position within the part, defined by the parts model.
The origin is at the position of the part, as returned by
SpaceEx.SpaceCenter.Part.position/3
.The axes rotate with the part.
The x, y and z axis directions depend on the design of the part.
For docking port parts, this reference frame is not necessarily equivalent to the
reference frame for the docking port, returned by
SpaceEx.SpaceCenter.DockingPort.get_reference_frame/2
.
A SpaceEx.SpaceCenter.ResourceConverter
if the part is a resource converter,
otherwise nil
.
A SpaceEx.SpaceCenter.ResourceHarvester
if the part is a resource harvester,
otherwise nil
.
A SpaceEx.SpaceCenter.Resources
object for the part.
A SpaceEx.SpaceCenter.Sensor
if the part is a sensor, otherwise nil
.
Whether the part is shielded from the exterior of the vessel, for example by a fairing.
Temperature of the skin of the part, in Kelvin.
A SpaceEx.SpaceCenter.SolarPanel
if the part is a solar panel, otherwise nil
.
The stage in which this part will be activated.
Returns -1 if the part is not activated by staging.
The name tag for the part.
Can be set to a custom string using the in-game user interface.
This requires either the NameTag or kOS mod to be installed.
Temperature of the part, in Kelvin.
The rate at which heat energy is conducting into or out of the part via contact with other parts.
Measured in energy per unit time, or power, in Watts. A positive value means the part is gaining heat energy, and negative means it is losing heat energy.
The rate at which heat energy is convecting into or out of the part from the surrounding atmosphere.
Measured in energy per unit time, or power, in Watts. A positive value means the part is gaining heat energy, and negative means it is losing heat energy.
The rate at which heat energy is begin generated by the part.
For example, some engines generate heat by combusting fuel. Measured in energy per unit time, or power, in Watts. A positive value means the part is gaining heat energy, and negative means it is losing heat energy.
A measure of how much energy it takes to increase the internal temperature of the part, in Joules per Kelvin.
The rate at which heat energy is radiating into or out of the part from the surrounding environment.
Measured in energy per unit time, or power, in Watts. A positive value means the part is gaining heat energy, and negative means it is losing heat energy.
A measure of how much energy it takes to increase the temperature of the resources contained in the part, in Joules per Kelvin.
A measure of how much energy it takes to increase the skin temperature of the part, in Joules per Kelvin.
The rate at which heat energy is transferring between the part's skin and its internals.
Measured in energy per unit time, or power, in Watts. A positive value means the part's internals are gaining heat energy, and negative means its skin is gaining heat energy.
Title of the part, as shown when the part is right clicked in-game.
For example "Mk1-2 Command Pod".
The vessel that contains this part.
A SpaceEx.SpaceCenter.Wheel
if the part is a wheel, otherwise nil
.
Exert an instantaneous force on the part, acting at the given position.
force
— A vector pointing in the direction that the force acts, with its magnitude equal to the strength of the force in Newtons.position
— The position at which the force acts, as a vector.referenceFrame
— The reference frame that the force and position are in. The force is applied instantaneously in a single physics update.
The position of the part in the given reference frame.
Returns: The position as a vector.
referenceFrame
— The reference frame that the returned position vector is in.
This is a fixed position in the part, defined by the parts model.
It s not necessarily the same as the parts center of mass.
Use SpaceEx.SpaceCenter.Part.center_of_mass/3
to get the parts center of mass.
The rotation of the part, in the given reference frame.
Returns: The rotation as a quaternion of the form \((x, y, z, w)\).
referenceFrame
— The reference frame that the returned rotation is in.
The color used to highlight the part, as an RGB triple.
Whether the part is highlighted.
The name tag for the part.
Can be set to a custom string using the in-game user interface.
This requires either the NameTag or kOS mod to be installed.
The linear velocity of the part in the given reference frame.
Returns: The velocity as a vector. The vector points in the direction of travel, and its magnitude is the speed of the body in meters per second.
referenceFrame
— The reference frame that the returned velocity vector is in.