cometsfactory 0.0.1

Comet factory — classify, build and catalogue comets of any type: short-period, long-period, Halley-type, sungrazer, interstellar, main-belt comet, centaur-transition, and extinct.
Documentation
  • Coverage
  • 25.93%
    84 out of 324 items documented0 out of 200 items with examples
  • Size
  • Source code size: 88.15 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 10.86 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 3m 29s Average build duration of successful builds.
  • all releases: 1m 43s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • celestial4498-prog

CometsFactory

Procedural comet generator for the Celestial Bodies ecosystem.
Build, classify, and catalogue comets of every dynamical family — from Jupiter-family short-period comets to interstellar visitors.


Architecture

Module File(s) Purpose
config parameters.rs Physical constants, orbital helpers, sublimation constants
types short_period.rs, long_period.rs, halley_type.rs, sungrazer.rs, interstellar.rs, main_belt_comet.rs, centaur_transition.rs, extinct.rs 8 comet types with builder pattern
physics gravity.rs, sublimation.rs Binding energy, tides, Roche limit, sublimation rates, gas production, non-grav acceleration
engine orbits.rs, evolution.rs, coma.rs Keplerian propagation, mantle growth, spin-up, coma/tail modelling
observables photometry.rs, tail.rs Total/nuclear magnitudes, Afρ, dust/ion tail orientation, disconnection events
utils helpers.rs, io.rs Angle conversions, summary lines for all 8 types

Comet Types

# Type Key Features
1 ShortPeriod Jupiter-family comets, P < 20 yr, 2 < T_J < 3
2 LongPeriod Oort Cloud origin, P > 200 yr, dynamically new flag
3 HalleyType 20 < P < 200 yr, T_J < 2, retrograde detection
4 Sungrazer Kreutz/Marsden/Kracht/Meyer groups, tidal disruption
5 Interstellar Hyperbolic orbits (e > 1), excess velocity
6 MainBeltComet Asteroid-like orbits (T_J > 3), sublimation-driven activity
7 CentaurTransition CO-driven outbursts, giant-planet region, dynamical lifetime
8 Extinct Dormant/extinct states, mantle thickness, reactivation potential

All types expose a builder pattern: new()with_*() chainable methods.


Usage

use cometsfactory::types::*;

let jfc = ShortPeriod::new(500.0, 3.5, 0.6)
    .with_density(600.0)
    .with_inclination(10.0)
    .with_active_fraction(0.03);

assert!(jfc.is_jupiter_family());
assert!(jfc.perihelion() < jfc.semi_major_axis);
use cometsfactory::physics::sublimation;

let q = sublimation::gas_production_rate(1000.0, 0.05, 1.0, 0.04);
assert!(q > 1.0e20);

Tests

73 tests across 3 test suites:

  • types_tests — 38 tests (builders, orbital properties, classifications)
  • physics_tests — 14 tests (gravity, sublimation, thermal)
  • engine_tests — 21 tests (orbits, evolution, coma)
cargo test --all-targets

Examples

Example Description
generation Creates all 8 comet types, exercises enum dispatch
physics Gravity + sublimation computations on a Jupiter-family comet
observables Photometry, Afρ, dust/ion tails, disconnection events
cargo run --example generation
cargo run --example physics
cargo run --example observables

License

MIT — Copyright (c) 2026 Rayan Morel