Chemist...le::VRML(3)
π 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 originalChemistry::Molobject. 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 is0.15.ball_radiusβ defines the factor that gets multiplied with the VDW radius for the spheres in the'BallAndWire'and'BallAndStick'style. default is0.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. π
π COPYRIGHT π
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 π
PDB2VRMLfound athttp://www.realitydiluted.com/mirrors/reality.sgi.com/horstv_basel/pdb2vrml/- PerlMol project at
http://www.perlmol.org/
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
- fedora 44: perl-Chemistry-File-VRML 0.10-1.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms