space_ex v0.8.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
A SpaceEx.SpaceCenter.Antenna if the part is an antenna, otherwise nil
Whether the part is axially attached to its parent, i.e
The axis-aligned bounding box of the part in the given reference frame
A SpaceEx.SpaceCenter.CargoBay if the part is a cargo bay, otherwise nil
The position of the parts center of mass in the given reference frame
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
The direction the part points in, in the given reference frame
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)
Exert an instantaneous force on the part, acting at the given position
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
The position of the part in the given reference frame
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
The rotation of the part, in the given reference frame
A SpaceEx.SpaceCenter.Sensor if the part is a sensor, otherwise nil
The color used to highlight the part, as an RGB triple
Whether the part is highlighted
The name tag for the part
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 linear velocity of the part in the given reference frame
The vessel that contains this part
A SpaceEx.SpaceCenter.Wheel if the part is a wheel, otherwise nil
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.reference_frame— The reference frame that the force and position are in.
Returns: a reference to a SpaceEx.SpaceCenter.Force object
A SpaceEx.SpaceCenter.Antenna if the part is an antenna, otherwise nil.
Returns: a reference to a SpaceEx.SpaceCenter.Antenna object
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.
Returns: true or false
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.
reference_frame— 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/2 of the part.
Returns: {{double, double, double}, {double, double, double}}, where double is a high precision decimal
A SpaceEx.SpaceCenter.CargoBay if the part is a cargo bay, otherwise nil.
Returns: a reference to a SpaceEx.SpaceCenter.CargoBay object
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/2.
Returns the position as a vector.
reference_frame— The reference frame that the returned position vector is in.
Returns: {double, double, double}, where double is a high precision decimal
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/2.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.reference_frame/1.
Returns: a reference to a SpaceEx.SpaceCenter.ReferenceFrame object
The parts children.
Returns an empty list if the part has no children.
This, in combination with SpaceEx.SpaceCenter.Part.parent/1, can be used to traverse the vessels
parts tree.
Returns: [part, ...], where part is a reference to a SpaceEx.SpaceCenter.Part object
A SpaceEx.SpaceCenter.ControlSurface if the part is an aerodynamic control surface,
otherwise nil.
Returns: a reference to a SpaceEx.SpaceCenter.ControlSurface object
The cost of the part, in units of funds.
Returns: a high precision decimal
Whether this part is crossfeed capable.
Returns: true or false
The stage in which this part will be decoupled.
Returns -1 if the part is never decoupled from the vessel.
Returns: an integer
A SpaceEx.SpaceCenter.Decoupler if the part is a decoupler, otherwise nil.
Returns: a reference to a SpaceEx.SpaceCenter.Decoupler object
The direction the part points in, in the given reference frame.
Returns the direction as a unit vector.
reference_frame— The reference frame that the returned direction is in.
Returns: {double, double, double}, where double is a high precision decimal
A SpaceEx.SpaceCenter.DockingPort if the part is a docking port, otherwise nil.
Returns: a reference to a SpaceEx.SpaceCenter.DockingPort object
The mass of the part, not including any resources it contains, in kilograms.
Returns zero if the part is massless.
Returns: a high precision decimal
The dynamic pressure acting on the part, in Pascals.
Returns: a low-precision decimal
An SpaceEx.SpaceCenter.Engine if the part is an engine, otherwise nil.
Returns: a reference to a SpaceEx.SpaceCenter.Engine object
An SpaceEx.SpaceCenter.Experiment if the part is a science experiment, otherwise nil.
Returns: a reference to a SpaceEx.SpaceCenter.Experiment object
A SpaceEx.SpaceCenter.Fairing if the part is a fairing, otherwise nil.
Returns: a reference to a SpaceEx.SpaceCenter.Fairing object
The parts that are connected to this part via fuel lines, where the direction of the fuel line is into this part.
Returns: [part, ...], where part is a reference to a SpaceEx.SpaceCenter.Part object
The parts that are connected to this part via fuel lines, where the direction of the fuel line is out of this part.
Returns: [part, ...], where part is a reference to a SpaceEx.SpaceCenter.Part object
The color used to highlight the part, as an RGB triple.
Returns: {double, double, double}, where double is a high precision decimal
Whether the part is highlighted.
Returns: true or false
The impact tolerance of the part, in meters per second.
Returns: a high precision decimal
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.
Returns: [double, ...], where double is a high precision decimal
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.reference_frame— The reference frame that the force and position are in. The force is applied instantaneously in a single physics update.
Returns: :ok
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.
Returns: a reference to a SpaceEx.SpaceCenter.Intake object
Whether this part is a fuel line.
Returns: true or false
A SpaceEx.SpaceCenter.LaunchClamp if the part is a launch clamp, otherwise nil.
Returns: a reference to a SpaceEx.SpaceCenter.LaunchClamp object
A SpaceEx.SpaceCenter.Leg if the part is a landing leg, otherwise nil.
Returns: a reference to a SpaceEx.SpaceCenter.Leg object
A SpaceEx.SpaceCenter.Light if the part is a light, otherwise nil.
Returns: a reference to a SpaceEx.SpaceCenter.Light object
The current mass of the part, including resources it contains, in kilograms.
Returns zero if the part is massless.
Returns: a high precision decimal
Whether the part is massless.
Returns: true or false
Maximum temperature that the skin of the part can survive, in Kelvin.
Returns: a high precision decimal
Maximum temperature that the part can survive, in Kelvin.
Returns: a high precision decimal
The modules for this part.
Returns: [module, ...], where module is a reference to a SpaceEx.SpaceCenter.Module object
The moment of inertia of the part in \(kg.m^2\) around its center of mass
in the parts reference frame (SpaceEx.SpaceCenter.ReferenceFrame).
Returns: {double, double, double}, where double is a high precision decimal
Internal name of the part, as used in part cfg files.
For example “Mark1-2Pod”.
Returns: a string
A SpaceEx.SpaceCenter.Parachute if the part is a parachute, otherwise nil.
Returns: a reference to a SpaceEx.SpaceCenter.Parachute object
The parts parent.
Returns nil if the part does not have a parent.
This, in combination with SpaceEx.SpaceCenter.Part.children/1, can be used to traverse the vessels
parts tree.
Returns: a reference to a SpaceEx.SpaceCenter.Part object
The position of the part in the given reference frame.
Returns the position as a vector.
reference_frame— 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/2 to get the parts center of mass.
Returns: {double, double, double}, where double is a high precision decimal
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.
Returns: true or false
A SpaceEx.SpaceCenter.Radiator if the part is a radiator, otherwise nil.
Returns: a reference to a SpaceEx.SpaceCenter.Radiator object
A SpaceEx.SpaceCenter.RCS if the part is an RCS block/thruster, otherwise nil.
Returns: a reference to a SpaceEx.SpaceCenter.RCS object
A SpaceEx.SpaceCenter.ReactionWheel if the part is a reaction wheel, otherwise nil.
Returns: a reference to a SpaceEx.SpaceCenter.ReactionWheel object
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/2.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.reference_frame/1.
Returns: a reference to a SpaceEx.SpaceCenter.ReferenceFrame object
A SpaceEx.SpaceCenter.ResourceConverter if the part is a resource converter,
otherwise nil.
Returns: a reference to a SpaceEx.SpaceCenter.ResourceConverter object
A SpaceEx.SpaceCenter.ResourceHarvester if the part is a resource harvester,
otherwise nil.
Returns: a reference to a SpaceEx.SpaceCenter.ResourceHarvester object
A SpaceEx.SpaceCenter.Resources object for the part.
Returns: a reference to a SpaceEx.SpaceCenter.Resources object
The rotation of the part, in the given reference frame.
Returns the rotation as a quaternion of the form \((x, y, z, w)\).
reference_frame— The reference frame that the returned rotation is in.
Returns: {double, double, double, double}, where double is a high precision decimal
A SpaceEx.SpaceCenter.Sensor if the part is a sensor, otherwise nil.
Returns: a reference to a SpaceEx.SpaceCenter.Sensor object
The color used to highlight the part, as an RGB triple.
Returns: :ok
Whether the part is highlighted.
Returns: :ok
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.
Returns: :ok
Whether the part is shielded from the exterior of the vessel, for example by a fairing.
Returns: true or false
Temperature of the skin of the part, in Kelvin.
Returns: a high precision decimal
A SpaceEx.SpaceCenter.SolarPanel if the part is a solar panel, otherwise nil.
Returns: a reference to a SpaceEx.SpaceCenter.SolarPanel object
The stage in which this part will be activated.
Returns -1 if the part is not activated by staging.
Returns: an integer
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.
Returns: a string
Temperature of the part, in Kelvin.
Returns: a high precision decimal
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.
Returns: a low-precision decimal
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.
Returns: a low-precision decimal
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.
Returns: a low-precision decimal
A measure of how much energy it takes to increase the internal temperature of the part, in Joules per Kelvin.
Returns: a low-precision decimal
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.
Returns: a low-precision decimal
A measure of how much energy it takes to increase the temperature of the resources contained in the part, in Joules per Kelvin.
Returns: a low-precision decimal
A measure of how much energy it takes to increase the skin temperature of the part, in Joules per Kelvin.
Returns: a low-precision decimal
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.
Returns: a low-precision decimal
Title of the part, as shown when the part is right clicked in-game.
For example “Mk1-2 Command Pod”.
Returns: a string
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.
reference_frame— The reference frame that the returned velocity vector is in.
Returns: {double, double, double}, where double is a high precision decimal
The vessel that contains this part.
Returns: a reference to a SpaceEx.SpaceCenter.Vessel object
A SpaceEx.SpaceCenter.Wheel if the part is a wheel, otherwise nil.
Returns: a reference to a SpaceEx.SpaceCenter.Wheel object