TransWikia.com

Cross-section parts of a Cube and show results graphically

Mathematica Asked by Steve237 on February 23, 2021

I am trying to visualize a 3D section of a chopped up 1x1x1 Cube. I don’t want to use the Cube[] function to draw this. (unless you think you can still accomplish it that way). Ok, so say you have a simple XY plane, laying flat on the table (lengths 1×1) Now I draw 2 straight lines across it with equations: Y=X+1/2 and Y=X-1/2 and shade the region in between. (it’ll take up 75% of the 1×1 region of course with the top left and bottom right squares being half shaded now, and the other 2 squares fully shaded). Ok simple enough so far.

Now let’s draw up the Z-axis above this (Hold the ruler perpendicular to the table up to a height of 1). Now raise/stretch that same shaded region above to the top, which will still take up the 75% of the now-8 0.5×0.5 cubes). with 2/8 unshaded. Ok now imagine the ZX plane (facing you on the table) and draw up the same 2 equations, now: Z=X+1/2 and Z=X-1/2 so you now have the same regions covering the ZX plane and they now travel to the back of the Cube – and the main point, now intersect the previous region (coming up from XY plane).

I like to visualize both shaded intersection. In other words, how can I draw up both regions, shade them, then put them into 3D for both planes and be able to rotate that final 3D image in any direction I like to visualize that highlighted 3D-intersection.

P.S. Too much in language, for those who like pure equations, in a nutshell this is all I need:

Y=X(+/-)1/2 and Z=X(+/-)1/2 < == 3D Plot and visualize intersection region in between the 2 pairs of lines on each plane.

Assume/hope your solution can take in any Function cutting the cube: Say Y=f(X) and Z=g(X)?

Co-incidentally, assume this is also possible to solve algebraically?

2 Answers

Reply the comment.

@Steve237

RegionPlot3D[
 And @@ {x - 1/2 <= y <= x + 1/2, x - 1/2 <= z <= x + 1/2, 
   0 <= x <= 1, 0 <= y <= 1, 0 <= z <= 1}, {x, 0, 1}, {y, 0, 1}, {z, 
  0, 1}, PlotPoints -> 80, PlotStyle -> Opacity[0.2], Mesh -> None, 
 BoundaryStyle -> Blue, AxesLabel -> {"x", "y", "z"}, 
 LabelStyle -> Directive[Red, Bold], TicksStyle -> Orange]

enter image description here

Correct answer by cvgmt on February 23, 2021

Here is an approach that seems to stem from the equations you mentioned at the end. I am not sure that I have interpreted them correctly, but even if I have not, perhaps it will get you started:

DiscretizeRegion[
  ImplicitRegion[
    {x - 1/2 <= y <= x + 1/2, x - 1/2 <= z <= x + 1/2}, {x, y, z}
  ],
  {{0, 1}, {0, 1}, {0, 1}},
  Axes -> True, Boxed -> True,
  Method -> "Semialgebraic"
]

3D representation of region

Answered by MarcoB on February 23, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP