Skip to content

Commit

Permalink
Use original extents in OBJ Writer (#19301) (#19310)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinPrivitera committed Feb 14, 2024
1 parent a5a2e9d commit 57dcf45
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/avt/FileWriter/avtDatasetFileWriter.C
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,10 @@ avtDatasetFileWriter::WriteOBJTree(avtDataTree_p dt, int idx,
// the colors associated with these two texture coordinates, producing a color
// that may not be in the table. To work-around this behavior, we *pad* the color
// texture duplicating the minimum and maximum color pixels on each end.
//
// Justin Privitera, Mon Feb 12 15:20:31 PST 2024
// I moved the extents calculation to the beginning to get around the bugged
// vtkCellDataToPointData.
//
// ****************************************************************************

Expand All @@ -399,6 +403,12 @@ avtDatasetFileWriter::WriteOBJFile(vtkDataSet *ds,
// Make sure that we have polydata.
vtkGeometryFilter *geom = vtkGeometryFilter::New();

// Compute the range here since VTK cannot be trusted to get the extents
// right after transforming from cell data to point data.
// See https://github.com/visit-dav/visit/issues/19028
double range[2];
activeDS->GetScalarRange(range);

//
// The OBJ file is going to expect the dataset as having node-centered
// data.
Expand Down Expand Up @@ -434,8 +444,6 @@ avtDatasetFileWriter::WriteOBJFile(vtkDataSet *ds,
//
// Get some information for normalizing the variable.
//
double range[2];
activeDS->GetScalarRange(range);
double gap = (range[1] != range[0] ? range[1] - range[0] : 1.);

//
Expand Down
1 change: 1 addition & 0 deletions src/resources/help/en_US/relnotes3.4.1.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<li>Removed custom logic forcing the opacity slider to snap to zero if the mouse dragged the slider outside the widget it belongs to.</li>
<li>Fixed a bug in the Blueprint reader causing unstructured point topologies to display incorrectly if they did not use all of the provided coordinates.</li>
<li>Removed sxterm host profile options for LLNL LSF Machines. sxterm is not available on these systems.</li>
<li>Fixed a bug in the Wavefront OBJ Writer that caused zonal variables saved out using the writer to have some incorrect colors in downstream tools such as PowerPoint.</li>
</ul>

<a name="Enhancements"></a>
Expand Down

0 comments on commit 57dcf45

Please sign in to comment.