coin_hardcopy(3)

πŸ“¦
version 4.0.10 Β· 4 versions
, in fedora 43, fedora 44

πŸ’… coin_hardcopy β€” bestie edition πŸ’…

okay so this is the Coin manpage for coin_hardcopy(3), and it's literally all about the Vectorized Printing Classes. no cap. let's get into it 🫢


✨ NAME ✨

coin_hardcopy β€” Vectorized Printing Classes

  • the vectorized printing classes are for rendering to vector devices instead of raster devices. that's the whole vibe. πŸ’–

🌈 SYNOPSIS 🌈

πŸŽ€ Classes πŸŽ€

  • class SoHardCopy β€” the SoHardCopy class is a static class for initializing the hardcopy support. it just… exists to set things up, iconic behavior honestly.
  • class SoPSVectorOutput β€” the SoPSVectorOutput class is used for writing PostScript. πŸ’…
  • class SoVectorOutput β€” the SoVectorOutput class is used for setting vector output file.
  • class SoVectorizeAction β€” the SoVectorizeAction class is the base class for vectorizing Coin scene graphs.
  • class SoVectorizePSAction β€” the SoVectorizePSAction class is used for rendering to a PostScript file.

πŸ¦‹ Detailed Description πŸ¦‹

the vectorized printing classes are for rendering to vector devices instead of raster devices.

you can use this to e.g. generate scalable PostScript images for printing instead of raster images that will become pixelated when you scale them up. pixelated? in THIS economy? not on my watch. 😭

see below for A HardCopy Overview. ✨

πŸ’œ A HardCopy Overview πŸ’œ

the main API for HardCopy support in Coin is the abstract class SoVectorizeAction. SoVectorizeAction will extract geometry from an Inventor scene graph, and project the geometry onto a specified page. since PostScript and other vector based file formats do not support z-buffer or depth clipping, all geometry is rendered using a simple painter's algorithm (geometry is sorted based on distance to camera). lowkey old school but it works, periodt.

SoVectorizePSAction inherits SoVectorizeAction, and will output a PostScript file.

texture-mapped polygons are not supported, since this is not supported by the vector file formats, at least it is not supported in PostScript. Gouraud shading is not supported in the PostScript language (at least not for V2.0), but an approximation is implemented using an algorithm that divides the triangle into several small (flat-shaded) triangles. the Gouraud shading quality (the number of sub-triangles) is controlled by an epsilon value. the Gouraud shading function is written by Frederic Delhoume (delhoume (at) ilog.fr), and is free (public domain) software. king behavior tbh πŸ‘‘

typical use of SoVectorizePSAction is shown in the following piece of code:

SoVectorizePSAction * ps = new SoVectorizePSAction;
SoVectorOutput * out = ps->getOutput();

if (!out->openFile("output.ps")) {
  return -1; // unable to open output file
}

// to enable Gouraud shading. 0.1 is a nice epsilon value
// ps->setGouraudThreshold(0.1f);

// clear to white background. Not really necessary if you
// want a white background
ps->setBackgroundColor(TRUE, SbColor(1.0f, 1.0f, 1.0f));

// select LANDSCAPE or PORTRAIT orientation
ps->setOrientation(SoVectorizeAction::LANDSCAPE);

// start creating a new page (A4 page, with 10mm border).
ps->beginPage(SbVec2f(10.0f, 10.0f), SbVec2f(190.0f, 277.0f));

// There are also enums for A0-A10. Example:
// ps->beginStandardPage(SoVectorizeAction::A4, 10.0f);

// calibrate so that text, lines, points and images will have the
// same size in the PostScript file as on the monitor.
ps->calibrate(viewer->getViewportRegion());

// apply action on the viewer scene graph. Remember to use
// SoSceneManager's scene graph so that the camera is included.
ps->apply(viewer->getSceneManager()->getSceneGraph());

// this will create the PostScript file
ps->endPage();

// close file
out->closeFile();

delete ps;

it is also possible to have several viewports and/or layers on a page. this is useful if your application has several layers of geometry, for instance some annotations in 2D on top of a 3D scene graph. to create several layers, the beginViewport() and endViewport() functions can be used. layers on layers on layers, we love to see it 🌸


🌟 Since 🌟

Coin 2.1

TGS provides HardCopy support as a separate extension for TGS Inventor.


πŸ’– Author πŸ’–

Generated automatically by Doxygen for Coin from the source code. (not a human, just a little robot doing its best 🧚)


and that's the whole page bestie, slay πŸ’…βœ¨

this masterpiece shipped as Version 4.0.10, dated Thu Jun 25 2026 00:00:00, and yeah it's coin_hardcopy(3) if you ever need to find it again. obsessed with her fr fr πŸ’œπŸ¦‹πŸŽ€

πŸ“¦ where this page comes from