Skip to main content

Crate xpict_core

Crate xpict_core 

Source
Expand description

Shared depiction core for xpict.

Python under python/xpict/ is still the working engine. This crate holds algorithms we are ready to share with PyO3 and WASM — start small, move modules as they stabilize. See the crate README.md for the migration rule.

Re-exports§

pub use align::kabsch_2d;
pub use align::rigid_align_coords;
pub use align::RigidTransform;
pub use bonds::bond_paths;
pub use bonds::bond_strokes;
pub use bonds::centered_displacements;
pub use bonds::depict_order;
pub use bonds::join_centered_multibonds;
pub use bonds::line_intersect;
pub use bonds::multi_bond_offset;
pub use bonds::BondStrokes;
pub use bonds::DrawnBond;
pub use bonds::StrokePath;
pub use colormap::colormap_rgb;
pub use colormap::sample_colormap;
pub use colormap::XENOSITE;
pub use depict::depict_molecule;
pub use elements::atomic_number;
pub use elements::element_symbol;
pub use elements::SYMBOLS;
pub use elk::layout_json as elk_layout_json;
pub use geom::capsule_halo_path_d;
pub use geom::disk_halo_path_d;
pub use geom::polygon_to_svg_d;
pub use labels::compose_label;
pub use labels::label_side;
pub use labels::place_backbone;
pub use labels::place_label;
pub use labels::shorten_bond;
pub use labels::split_label;
pub use labels::AtomIn;
pub use labels::BondIn;
pub use labels::BondOut;
pub use labels::LabelParts;
pub use labels::LabelSide;
pub use labels::PlacedLabel;
pub use markup::parse_label_markup;
pub use metrics::BOND_PX;
pub use metrics::OFFSET_FRAC;
pub use metrics::OFFSET_PX;
pub use metrics::SCALE;
pub use metrics::SHADE_FRAC;
pub use metrics::STROKE_PX;
pub use plotdot::PlotDot;
pub use plotdot::ShadeDisk;
pub use rings::apply_ring_interiors;
pub use rings::bond_interior_normals;
pub use rings::find_sssr;
pub use rings::Ring;
pub use scene::Layer;
pub use scene::LayerName;
pub use scene::MoleculeIn;
pub use scene::Primitive;
pub use scene::Scene;
pub use scene::TextAnchor;
pub use scene::Viewport;

Modules§

align
Rigid 2D alignment (Kabsch) — Indigo / no-RDKit fallback.
bonds
Bond strokes: skeleton centerlines, multi-bond offsets, stereo, joins.
colormap
Vendored xenosite colormap (from xenopict._cm_def / Python _xenosite_cm).
depict
Single-molecule depiction: MoleculeIn → Scene.
elements
Periodic table: atomic number ↔ element symbol.
elk
Multi-molecule diagram placement via elkrs (native ELK).
font
Bundled Liberation Sans outlines (ttf-parser).
geom
Geometry for halos and ink (Shapely stand-in).
labels
Atom-label orientation and backbone bond insets.
markup
Chem-label markup → ChemGlyphs.
metrics
Depiction proportions (xenopict / RDKit house style).
plotdot
Concentric plot-dot shading (xenopict PlotDot semantics).
rings
Practical SSSR and ring-interior normals for depiction.
scene
Drawable scene document — engine-neutral primitives shared by Python & JS.