3D plot confusion

8 views (last 30 days)
Minas Emiris
Minas Emiris on 13 Apr 2018
Answered: Wick on 2 May 2018
I am working on a project of 3D plots, and on objective is to create a UFO spaceship that has a curved shape that resembles a conical shape, but also has couple of equally-spaced square windows on its sides as shown on the uploaded photo. I have managed to create the shape neglecting the windows by first finding the function that the curve of the surface follows on the side view, creating a thin outer layer of the surface with the function 'cylinder' ([x y z] = cylinder(function of side curve), then defining the z values for different layers of the cylindrical shape). The issues I am now facing are:
1. How can I make square holes on the position of the windows?
2. How can I "fill" the interior of the spaceship with a solid surface as it normally is rather than an empty space?

Answers (1)

Wick
Wick on 2 May 2018
Assuming you're making the exterior of the ship from mesh or surface commands. Those commands will connect dots and make patches between vertices in their regular pattern unless it's a NaN. You can make selected values of any of the X, Y, or Z values equal to NaN and the won't be included in the surfaces.
I don't know of any solid plotting options in MATLAB. Everything is surfaces. You're just going to have to add a surface inside the UFO's windows to represent the interior of the UFO.
It might just be easier to define the patches where the windows are as a different color rather than trying to cut them out of the shape.

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!