Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've created a Graphics3D object by extruding a binary 2D image (as shown here).

pts = ImageData[ColorNegate@Binarize@Import[""], "Bit"];
g = RegionPlot3D[pts[[Sequence @@ Round@{i, j}]] == 1, {i, 1, #1}, {j, 1, #2},
  {z, 0, 300}, PlotPoints -> 100, Mesh -> False, Axes -> True, 
  Boxed -> False] & @@ Dimensions[pts]

enter image description here

This object has dimensions 600 $\times$ 600 $\times$ 300 and it is centered on (300, 300, 150). In other words, all coordinates are within the ranges of the given dimensions.

My need is to be able to rescale this object by preserving the same Graphics3D structure (i.e., including vertices, polygons, vertex normals, etc.). The new ranges of dimensions I'm looking for are ((-0.5, 0.5), (-0.5, 0.5), (-0.25, 0.25)).

I had no troubles to rescale the coordinates of the GraphicsComplex, but these are not enough to then export the Graphics3D as an .obj file. A second approach that I took was to use TetGenLink to recompute the needed information, but since my object has also concavities this did not work as expected.

Has anyone done this before? Any suggestion is more than welcome.

share|improve this question
up vote 2 down vote accepted

How about using RescalingTransform:

                          RescalingTransform[{{1, 600}, {1, 600}, {0, 300}}, 
                                             {{-.5, .5}, {-.5, .5}, {-.25, .25}}]]}
          , Axes -> True]

enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.