3D plot confusion

1 vue (au cours des 30 derniers jours)
Minas Emiris
Minas Emiris le 13 Avr 2018
Réponse apportée : Wick le 2 Mai 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?

Réponses (1)

Wick
Wick le 2 Mai 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.

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by