Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

10
  • $\begingroup$ Related: How to extrude a 3D image from a binary 2D image. $\endgroup$ Commented Jul 21, 2014 at 12:53
  • $\begingroup$ @Mr.Wizard,I think it isn't duplicte,because (6206) is just a image,not a geomatry that can rotate. $\endgroup$ Commented Jul 21, 2014 at 12:58
  • $\begingroup$ @Mr.Wizard,I would like to use a geomatry that can rotate freely to construct a robot model,Can you help me? $\endgroup$ Commented Jul 21, 2014 at 13:03
  • 1
    $\begingroup$ @Mr.Wizard,In Jens's method,ColorReplace and Raster3D is not in V8,in addition,halirutan's solution takes many time to calculate and it is hard to rotate. $\endgroup$ Commented Jul 21, 2014 at 14:39
  • 2
    $\begingroup$ Does this do the sort of thing you are looking for? - extrude = {0, 0, 1}; rule2Dto3D = {x_?AtomQ, y_?AtomQ} :> {x, y, 0}; ruleLine2Polygon = Line[{p_?VectorQ, q_?VectorQ}] :> Polygon[{p, q, q + extrude, p + extrude}]; ruleCircle2Cylinder = Circle[p_?VectorQ, r_?AtomQ] :> Cylinder[{p, p + extrude}, r]; object2D = {Line[{{0, 0}, {8, 0}}], Circle[{0, 0}, 2], Circle[{8, 0}, 1]}; object3D = object2D /. rule2Dto3D /. {ruleLine2Polygon, ruleCircle2Cylinder}; {Graphics@object2D, Graphics3D@object3D}. It is limited to extruding line segments and circles, but extra 2D to 3D rules could be added. $\endgroup$ Commented Jul 21, 2014 at 14:53