NAME

Qhull::Util - Various bits and pieces

VERSION

version 0.06

SYNOPSIS

SUBROUTINES

supported_output_format

$bool = supported_output_format( $format );

Returns true if parsing for $format (a Qhull output format flag) is supported.

parse_output

@results = parse_output( \%options, $output, @output_formats );

Parses output from qhull based on the specified output_formats (e.g. p, f, Fx), which must be in the same order as specified to qhull.

Returns a list of parsed data, one element per output format. See the parse_output_* routines for the structure of the parsed data.

The following options are available:

  • trace

    Add line number information to the parsed output which identifies the input line containing the data. Each output format will record it differently.

parse_output_facets

( $line_no, \%parsed_data ) = parse_output_facets( \%option, \$buffer, $line_no );

Parse f (facets & vertices) formatted output. pos($buffer) must be the offset into $buffer where the data start. $line_no is the line number corresponding to that offset. The updated line number is returned as well as the parsed data.

The parsed data are in the following structure:

{ vertices => \@vertices, facets => \@facets }

@vertices is an array of hashes, on per vertex, each with the following elements:

  • point id

  • vertex id

  • coords - an arrayref of coordinate values

  • line_no - only present if the trace option is set;

@facets is an array of hashes, on per facet. The entries in a facet hash will depend upon the format parameters passed to qhull.

If the trace option is specified, then there will be an additional entry line_no which is a hash keyed off of the names of the facet entry attributes, whose values are the line numbers in the input they appear on.

parse_output_vertices

( $line_no, \@vertices ) = parse_output_vertices( \%option, \$buffer, $line_no );

Parse p (vertices) formatted output. pos($buffer) must be the offset into $buffer where the data start. $line_no is the line number corresponding to that offset. The updated line number is returned as well as the parsed data.

@vertices is an array of coordinate arrayrefs, one per vertex. If the trace option is specified, the first element in the coordinate array is the line number in the output the data were parsed from.

parse_extreme_points

( $line_no, \@indices ) = parse_extreme_points( \%option, \$buffer, $line_no );

Parse Fx (extreme point) formatted output. pos($buffer) must be the offset into $buffer where the data start. $line_no is the line number corresponding to that offset. The updated line number is returned as well as the parsed data.

@indices is an array of indices, one per extreme point. If the trace option is specified, the elements in @indices are array refs, with the first element the line number in the output the indices were parsed from.

parse_size

( $line_no, \%sizes ) = parse_size( \%option, \$buffer, $line_no );

Parse FS (size) formatted output. pos($buffer) must be the offset into $buffer where the data start. $line_no is the line number corresponding to that offset. The updated line number is returned as well as the parsed data.

\%size is a hash with the following entries:

  • area

  • volume

  • line_no - only present if the trace option is set;

If the trace option is specified, then there will be an additional entry line_no which is a hash keyed off of the names of the other attributes, whose values are the line numbers in the input they appear on.

SUPPORT

Bugs

Please report any bugs or feature requests to bug-qhull@rt.cpan.org or through the web interface at: https://rt.cpan.org/Public/Dist/Display.html?Name=Qhull

Source

Source is available at

https://gitlab.com/djerius/p5-qhull

and may be cloned from

https://gitlab.com/djerius/p5-qhull.git

SEE ALSO

Please see those modules/websites for more information related to this module.

AUTHOR

Diab Jerius <djerius@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2024 by Smithsonian Astrophysical Observatory.

This is free software, licensed under:

The GNU General Public License, Version 3, June 2007