Chemist...le::VRML(3)

πŸ“¦ version 0.10, in fedora 44

πŸ’– Chemistry::File::VRML β€” the manual, but make it cute πŸ’–

okay so bestie, this is a page from the User Contributed Perl Documentation corner of the Perl world, and it's literally all about Chemistry::File::VRML. pull up a chair, grab a strawberry πŸ“, and let's get into it.


✨ NAME ✨

Chemistry::File::VRML β€” generate VRML models for molecules. yes, like, 3D models. of molecules. we're building tiny worlds out here. πŸ¦‹


🌈 SYNOPSIS 🌈

here's the whole vibe, verbatim, do not touch:

use Chemistry::File::PDB;
use Chemistry::File::VRML;
use Chemistry::Bond::Find 'find_bonds';

my $mol = Chemistry::Mol->read('test.pdb');
find_bonds($mol, orders => 1);
$mol->write('test.wrl', format => 'vrml',
    center => 1,
    style  => 'ballAndWire',
    color  => 'byAtom',
);

read the PDB, find the bonds, write a .wrl. that's it. that's the whole arc. main character energy from start to finish πŸ‘‘


πŸŽ€ DESCRIPTION πŸŽ€

so this module makes a VRML β€” that's Virtual Reality Modeling Language, no cap β€” representation of a molecule. once it's made, you can look at it in literally any VRML viewer. slay.

it's a PerlMol file I/O plugin, and it registers the 'vrml' format with Chemistry::Mol. so like, Chemistry::Mol knows who she is.

but listen. this plugin is write-only. there is no way of reading a VRML file back into a molecule. it's giving one-way street. it gives, it does not receive. do not come for her asking to read, because she will not. πŸ’€

also, fun lore: this module is a modification of PDB2VRML by Horst Vollhardt, adapted to the Chemistry::File interface. glow-up complete ✨


πŸ’… OPTIONS πŸ’…

these are the options you can pass to $mol->write. write them down, bestie.

  • center β€” if it's true, shift the molecule's center of geometry into the origin of the coordinate system. ✨ note (and this is important): this only affects the output. it does not affect the coordinates of the atoms in the original Chemistry::Mol object. your molecule stays unbothered. untouched. unbothered.
  • style β€” sets the style for the VRML representation of the molecular structure. default is 'Wireframe'. currently supported styles are:
Wireframe, BallAndWire,
Stick, BallAndStick,
CPK
  • color β€” sets the overall color of the molecular structure. if the color is set to 'byAtom', the color for atoms and bonds is defined by the atom type. default is 'byAtom'. currently supported colors are:
byAtom,
yellow, blue, red,
green, white, brown,
grey, purple
  • stick_radius β€” defines the radius, in Angstrom, for the cylinders in the 'Stick' and 'BallAndStick' style. default is 0.15 .
  • ball_radius β€” defines the factor that gets multiplied with the VDW radius for the spheres in the 'BallAndWire' and 'BallAndStick' style. default is 0.2 .
  • compression β€” turns compression of the output on/off. if it's turned on, all leading whitespaces get removed. this produces a less readable but approx. 20% smaller output, and the speed is increased by 10% as well. small file, fast file, no thoughts, just vibes 🫢

🌸 AUTHOR 🌸

PDB2VRML originally by Horst Vollhardt, horstv@yahoo.com, 1998.

Modified and adapted as Chemistry::File::VRML by Ivan Tubert-Brohman, itub@cpan.org, 2005.

two icons, one lineage. the way that 1998 met 2005 and made this. iconic. 🌟


PDB2VRML Copyright (c) 1998 by Horst Vollhardt. All rights reserved.

Chemistry::File::VRML modifications Copyright (c) 2005 by Ivan Tubert-Brohman. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

periodt. legally iconic. πŸ’…


πŸ‘‘ SEE ALSO πŸ‘‘

go check them out, iykyk. πŸ”₯


and that's the whole page, bestie!! πŸŽ€ for the record, this doc lives in perl v5.42.2, dated 2026-05-17, and it's filed under that slightly cursed truncated title Chemist...le::VRML(3) (the name got a little chopped, we don't talk about it πŸ™ˆ). anyway β€” go build some molecules, make them spin in a VRML viewer, and slay. bye!! πŸ’–πŸ¦‹βœ¨

πŸ“¦ where this page comes from