Skip to content

Commit

Permalink
merge trunk to STABLE from r36450 to HEAD r36456
Browse files Browse the repository at this point in the history
svn:revision:36457
svn:branch:STABLE
svn:account:brlcad
  • Loading branch information
brlcad committed Nov 10, 2009
2 parents 2934a78 + 641a590 commit 48d5115
Show file tree
Hide file tree
Showing 14 changed files with 233 additions and 27 deletions.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ changes made. See document footer for additional details.
--- 2009-11-06 Release 7.16.2 ---
----------------------------------------------------------------------

* added manual page documentation for pix-ppm command - Sean Morrison
* added -o file output option to pix-png and pix-ppm - Sean Morrison
* improved NURBS geometry raytracing support - Keith Bowman
* improved mged 'opendb' prompting - Sean Morrison, Jack Devanney
Expand Down
2 changes: 1 addition & 1 deletion TODO
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ THESE ARE UNSCHEDULED BACKLOG TASKS
* modify the raytracers to use common fb and file output code

* add missing manual pages (jra generated list on 04.2007):
a-d archer asc2g asc2pix binfo bot-bldxf bottest brep_cube brep_simple brickwall btclsh burst bw-a bw-d bwish c-d chan_add clutter contours d-a damdf dauto dauto2 d-bw dconv ddisp d-f dfft d-i dmod double-asc dpeak dsel dsp_add dstat d-u dwin euclid_format euclid_unformat fbgammamod f-d fence fhor f-i files-tape g-adrt g-euclid1 g-jack globe g-off i-a i-d i-f ihist imod ipuscan ipustat istat jack-g kurt lowp molecule msrandom mst nmgmodel nmg-sgp off-g pipe pipetest pix2g pix3filter pixcount pixelswap pixembed pixfields pixfieldsep pixflip-fb pix-ipu pixpaste pix-ppm pix-spm pix-yuv plstat png-ipu pyramid rawbot remapid rlesortmap rletovcr room rtcell rtexample rtfrac rtrad rtsil rtsrv rtwizard script-tab sgi-pix sketch solshoot sphflake spltest spm-fb ssampview syn tea tea_nmg testfree texturescale torii ttcp tube txyz-pl u-a u-bw u-d u-f umod ustat vcrtorle vegitation wall wdb_example xbmtorle xyz-pl yuv-pix
a-d archer asc2g asc2pix binfo bot-bldxf bottest brep_cube brep_simple brickwall btclsh burst bw-a bw-d bwish c-d chan_add clutter contours d-a damdf dauto dauto2 d-bw dconv ddisp d-f dfft d-i dmod double-asc dpeak dsel dsp_add dstat d-u dwin euclid_format euclid_unformat fbgammamod f-d fence fhor f-i files-tape g-adrt g-euclid1 g-jack globe g-off i-a i-d i-f ihist imod ipuscan ipustat istat jack-g kurt lowp molecule msrandom mst nmgmodel nmg-sgp off-g pipe pipetest pix2g pix3filter pixcount pixelswap pixembed pixfields pixfieldsep pixflip-fb pix-ipu pixpaste pix-spm pix-yuv plstat png-ipu pyramid rawbot remapid rlesortmap rletovcr room rtcell rtexample rtfrac rtrad rtsil rtsrv rtwizard script-tab sgi-pix sketch solshoot sphflake spltest spm-fb ssampview syn tea tea_nmg testfree texturescale torii ttcp tube txyz-pl u-a u-bw u-d u-f umod ustat vcrtorle vegitation wall wdb_example xbmtorle xyz-pl yuv-pix

* design plugin system to allow domain specific tools (say, for example,
a tool to create propeller parts) to identify themselves and their
Expand Down
2 changes: 1 addition & 1 deletion src/archer/archer.bat
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ REM
SETLOCAL

REM XXX FIXME: SHOULD NOT NEED TO SET BRLCAD_DATA OR CAD_VERSION XXX
SET CAD_VERSION=7.16.1
SET CAD_VERSION=7.16.2

SET SAVE_CD=%CD%
SET PATH=%~dp0
Expand Down
58 changes: 58 additions & 0 deletions src/conv/step/OpenNurbsInterfaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ class SCLP23(Application_instance);
#include "RationalBSplineSurfaceWithKnots.h"
#include "RationalQuasiUniformSurface.h"
#include "RationalUniformSurface.h"
#include "SphericalSurface.h"
#include "ToroidalSurface.h"
#include "UniformSurface.h"

#include "AdvancedBrepShapeRepresentation.h"
Expand Down Expand Up @@ -2587,6 +2589,62 @@ SurfaceOfRevolution::LoadONBrep(ON_Brep *brep)
return true;
}

bool SphericalSurface::LoadONBrep(ON_Brep *brep)
{
// get sphere center
ON_3dPoint center = GetOrigin();
center = center * LocalUnits::length;

// Creates a sphere with given center and radius.
ON_Sphere sphere(center, radius * LocalUnits::length);

ON_RevSurface* s = sphere.RevSurfaceForm();
if (s) {
double r = fabs(sphere.radius);
if ( r <= ON_SQRT_EPSILON )
r = 1.0;
r *= ON_PI;
s->SetDomain(0,0.0,2.0*r);
s->SetDomain(1,-r,r);
}
ON_id = brep->AddSurface(s);

return true;
}

bool ToroidalSurface::LoadONBrep(ON_Brep *brep)
{
ON_3dPoint origin = GetOrigin();
ON_3dVector norm = GetNormal();
ON_3dVector xaxis = GetXAxis();
ON_3dVector yaxis = GetYAxis();

origin = origin * LocalUnits::length;

ON_Plane p(origin, xaxis, yaxis);

// Creates a torus parallel to the plane
// with given major and minor radius.
ON_Torus torus(p, major_radius * LocalUnits::length, minor_radius * LocalUnits::length);

ON_RevSurface* s = torus.RevSurfaceForm();
if (s) {
double r = fabs(torus.major_radius);
if (r <= ON_SQRT_EPSILON)
r = 1.0;
r *= ON_PI;
s->SetDomain(0, 0.0, 2.0 * r);
r = fabs(torus.minor_radius);
if (r <= ON_SQRT_EPSILON)
r = 1.0;
r *= ON_PI;
s->SetDomain(1, 0.0, 2.0 * r);
}
ON_id = brep->AddSurface(s);

return true;
}

bool
VertexLoop::LoadONBrep(ON_Brep *brep)
{
Expand Down
14 changes: 8 additions & 6 deletions src/conv/step/PullbackCurve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,6 @@ toUV(PBCData& data, ON_2dPoint& out_pt, double t, double knudge=0.0) {
out_pt.Set(uv.x,uv.y);
return true;
} else {
if ( data.surftree->getSurfacePoint((const ON_3dPoint&)pointOnCurve,uv,(const ON_3dPoint&)knudgedPointOnCurve) > 0 ) {
out_pt.Set(uv.x,uv.y);
return true;
}
return false;
}

Expand Down Expand Up @@ -1773,7 +1769,10 @@ resolve_pullback_seams(list<PBCData*> &pbcs) {
}

//2) walk rest of way down with resolved prev point
prev = &(*samples)[samples->Count() -1];
if (samples->Count() > 1)
prev = &(*samples)[samples->Count() -1];
else
prev = NULL;
si++;
while (cs != pbcs.end()) {
while(si != data->segments.end()) {
Expand All @@ -1782,7 +1781,10 @@ resolve_pullback_seams(list<PBCData*> &pbcs) {
if ( !resolve_seam_segment(surf,*samples)) {
resolve_seam_segment_from_prev(surf, *samples, prev);
}
prev = &(*samples)[samples->Count() -1];
if (samples->Count() > 1)
prev = &(*samples)[samples->Count() -1];
else
prev = NULL;
si++;
}
cs++;
Expand Down
32 changes: 23 additions & 9 deletions src/conv/step/SphericalSurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#include "STEPWrapper.h"
#include "Factory.h"

#include "Axis2Placement3D.h"

#include "SphericalSurface.h"

#define CLASSNAME "SphericalSurface"
Expand All @@ -44,6 +46,27 @@ SphericalSurface::SphericalSurface(STEPWrapper *sw,int STEPid) {
SphericalSurface::~SphericalSurface() {
}

const double *
SphericalSurface::GetOrigin() {
return position->GetOrigin();
}

const double *
SphericalSurface::GetNormal() {
return position->GetAxis(2);
}

const double *
SphericalSurface::GetXAxis() {
return position->GetXAxis();
}

const double *
SphericalSurface::GetYAxis() {
return position->GetYAxis();
}


bool
SphericalSurface::Load(STEPWrapper *sw, SCLP23(Application_instance) *sse) {
step=sw;
Expand Down Expand Up @@ -91,15 +114,6 @@ SphericalSurface::Create(STEPWrapper *sw, SCLP23(Application_instance) *sse) {
return (*i).second;
}
}

bool
SphericalSurface::LoadONBrep(ON_Brep *brep)
{
cerr << "Error: ::LoadONBrep(ON_Brep *brep) not implemented for " << entityname << endl;
return false;
}


// Local Variables:
// tab-width: 8
// mode: C++
Expand Down
4 changes: 4 additions & 0 deletions src/conv/step/SphericalSurface.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ class SphericalSurface: public ElementarySurface {
SphericalSurface();
virtual ~SphericalSurface();
SphericalSurface(STEPWrapper *sw,int STEPid);
const double *GetOrigin();
const double *GetNormal();
const double *GetXAxis();
const double *GetYAxis();
bool Load(STEPWrapper *sw,SCLP23(Application_instance) *sse);
virtual bool LoadONBrep(ON_Brep *brep);
virtual void Print(int level);
Expand Down
30 changes: 22 additions & 8 deletions src/conv/step/ToroidalSurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#include "STEPWrapper.h"
#include "Factory.h"

#include "Axis2Placement3D.h"

#include "ToroidalSurface.h"

#define CLASSNAME "ToroidalSurface"
Expand All @@ -44,6 +46,26 @@ ToroidalSurface::ToroidalSurface(STEPWrapper *sw,int STEPid) {
ToroidalSurface::~ToroidalSurface() {
}

const double *
ToroidalSurface::GetOrigin() {
return position->GetOrigin();
}

const double *
ToroidalSurface::GetNormal() {
return position->GetAxis(2);
}

const double *
ToroidalSurface::GetXAxis() {
return position->GetXAxis();
}

const double *
ToroidalSurface::GetYAxis() {
return position->GetYAxis();
}

bool
ToroidalSurface::Load(STEPWrapper *sw, SCLP23(Application_instance) *sse) {
step=sw;
Expand Down Expand Up @@ -94,14 +116,6 @@ ToroidalSurface::Create(STEPWrapper *sw, SCLP23(Application_instance) *sse) {
}
}

bool
ToroidalSurface::LoadONBrep(ON_Brep *brep)
{
cerr << "Error: ::LoadONBrep(ON_Brep *brep) not implemented for " << entityname << endl;
return false;
}


// Local Variables:
// tab-width: 8
// mode: C++
Expand Down
4 changes: 4 additions & 0 deletions src/conv/step/ToroidalSurface.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ class ToroidalSurface: public ElementarySurface {
ToroidalSurface();
virtual ~ToroidalSurface();
ToroidalSurface(STEPWrapper *sw,int STEPid);
const double *GetOrigin();
const double *GetNormal();
const double *GetXAxis();
const double *GetYAxis();
bool Load(STEPWrapper *sw,SCLP23(Application_instance) *sse);
virtual bool LoadONBrep(ON_Brep *brep);
virtual void Print(int level);
Expand Down
1 change: 1 addition & 0 deletions src/librt/opennurbs_ext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,7 @@ SurfaceTree::getSurfacePoint(const ON_3dPoint& pt, ON_2dPoint& uv, const ON_3dPo
} else if (NEAR_ZERO(dist,tolerance)) {
if (dist < min_dist) {
uv = curr_uv;
min_dist = dist;
found = true; //within tolerance but may be a point closer so keep looking
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/mged/mged.bat
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ REM
SETLOCAL

REM XXX FIXME: SHOULD NOT NEED TO SET BRLCAD_DATA OR CAD_VERSION XXX
SET CAD_VERSION=7.16.1
SET CAD_VERSION=7.16.2

SET SAVE_CD=%CD%
SET PATH=%~dp0
Expand Down
1 change: 1 addition & 0 deletions src/util/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@ man_MANS = \
pix-bw3.1 \
pix-orle.1 \
pix-png.1 \
pix-ppm.1 \
pix-ps.1 \
pix-rle.1 \
pix-sun.1 \
Expand Down
107 changes: 107 additions & 0 deletions src/util/pix-ppm.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
.TH PIX-PPM 1 BRL-CAD
.\" P I X - P P M . 1
.\" BRL-CAD
.\"
.\" Copyright (c) 2005-2009 United States Government as represented by
.\" the U.S. Army Research Laboratory.
.\"
.\" Redistribution and use in source (Docbook format) and 'compiled'
.\" forms (PDF, PostScript, HTML, RTF, etc), with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" 1. Redistributions of source code (Docbook format) must retain the
.\" above copyright notice, this list of conditions and the following
.\" disclaimer.
.\"
.\" 2. Redistributions in compiled form (transformed to other DTDs,
.\" converted to PDF, PostScript, HTML, RTF, and other formats) must
.\" reproduce the above copyright notice, this list of conditions and
.\" the following disclaimer in the documentation and/or other
.\" materials provided with the distribution.
.\"
.\" 3. The name of the author may not be used to endorse or promote
.\" products derived from this documentation without specific prior
.\" written permission.
.\"
.\" THIS DOCUMENTATION IS PROVIDED BY THE AUTHOR AS IS'' AND ANY
.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
.\" OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
.\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
.\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
.\" USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\".\".\"
.SH NAME
pix-ppm \- convert a BRL-CAD PIX or BW format image to a PPM format image
.SH SYNOPSIS
.B pix-ppm
.RB [ \-a ]
.RB [ \-s squaresize ]
.RB [ \-w file_width ]
.RB [ \-n file_height ]
.RB [ \-# bytes_per_pixel ]
.RB [ \-o PPM_file ]
[PIX_file]
.RB [ > PPM_file ]
.SH DESCRIPTION
.I pix-ppm
converts a
.I BRL PIX(5)
format file to a
.I PPM
(Portable PixMap) format file on the standard output. The PPM file
created will be either an RGB file with 3 bytes per pixel (default) or
a B&W file with 1 byte per pixel
.LP
PIX image files do not contain information about their size. The size
of the input PIX image file must be specified if the dimensions are
not the default 512x512 size.
.SH OPTIONS
.TP
.B \-a
autosize the input file to determine file image height and width
.TP
.B \-s squaresize
sets both the width and the height for the input to be
.I squaresize
.TP
.B \-w file_width
tells
.I pix-ppm
that the input is
.I file_width
pixels wide
.TP
.B \-n file_height
tells
.I pix-ppm
that the input is
.I file_height
scanlines tall
.TP
.B \-# bytes_per_pixel
tells
.I pix-ppm
how many bytes there are per pixel in the input PIX or BW file.
.TP
.B \-o PPM_file
tells
.I pix-ppm
to write image data to the specified
.I PPM_file
output file. The
.I pix-ppm
command will not write out binary image data directly to a terminal
device as a safeguard.
.SH "SEE ALSO"
brlcad(1), pix-png(1), pix-bw(1), bw-pix(1), pix-fb(1), pix(5), bw(5).
.SH "BUG REPORTS"
Reports of bugs or problems should be submitted via electronic
mail to <[email protected]>.
Loading

0 comments on commit 48d5115

Please sign in to comment.