Message Boards Message Boards

0
|
1139 Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Combine Graphics and Graphics3D objects

Posted 4 months ago

I have

Head[outline]

is Graphics

and

Head[foo]

is Graphics3D

When I do

Show[outline,foo]

I get "could not combine ..."

Is this supposed to work? I want the 2d object to be in the z=0 plane. (I;m running Mathematic 12.2)

POSTED BY: David Golber
4 Replies
Posted 4 months ago

POSTED BY: Denis Ivanov

You can use Texture:

Graphics3D[{Texture[Graphics[{Disk[]}]], 
  Polygon[{{-1, -1, 0}, {1, -1, 0}, {1, 1, 0}, {-1, 1, 0}}]}]

Also, have a look at Inset.

POSTED BY: Gianluca Gorni
Posted 4 months ago

Here's a module that converts (some) 2D Graphics to Graphics3D. It works on Graphics which use only the Primitive "Line" ... which happens to be all I need. Maybe Wolfram could finish it and make it apply to all Graphics expressions.

It looks through a Graphics expression (recursively), finds all "Line"s, and makes the defining points 3D.

Attachments:
POSTED BY: David Golber
Posted 4 months ago

Well, it runs out that the above doesn't work for more complicated stuff (even if the only primitive is "Line". There are things in the Graphics object that are private to (someone?), and don't work right.

Here's a module that works on the String level, and seems to work as I want (but still only for Line primitives.)

Attachments:
POSTED BY: David Golber
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract