In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This tool only reads and displays models (a bit of a chicken rib) and does not involve analysis or anything.
Let's show it first:
1. Click this button in the main interface first.
two。 To the interface of the tool for reading STL files
3. After clicking the open button, there will be a loaded animation in the box on the right
4. When the file is loaded, there will be a prompt
5. After two seconds, the model was displayed.
6. Before the model is displayed, I hide the toolbar on the left side. When you finish displaying the model, move the mouse over the area on the left side to display the toolbar, as follows:
1. When we open the subinterface from the first interface, there must be a need to return to the first interface.
You can return to the main interface in two ways: click the 'Xbox' in the upper-right corner, or click the home button in the upper-left corner of the interface.
If you click on the upper left corner to return to the front screen, you need to use figure's CloseRequestFcn callback function.
In this callback, set the Visible of the first interface to on, and the current figure in delete
The callback callback of the home button has the same idea.
two。 How to select the file that needs to be opened and display it in the coordinate system?
When we click the button to open the file,
* want to pop up a file selection dialog box, using the uigetfile function
* after selecting the appropriate file, start reading the vertices in the file, which may take a while. So during this period, you can complete an animation that is being loaded.
* this animation can be shown using either a loop or a timer timer. I use a timer. You can check the usage of the timer first, and then take a look at my code. Animation is actually a continuous display of several pictures, so we can go online to find some pictures, and then let the timer display a picture every 0.5 seconds.
* the loading animation I have here is made up of 5 pictures. How can I play them all over again after playing them? This is simple: take the current number of pictures to add 1 to the remainder of 5, and you will get the current number of pictures.
* after the file is loaded, you need to turn off the animated image and set Visible to off.
* then prompt the user that the file has been imported and the model is about to be displayed
* turn off the prompt
* use the method of reading the STL file in the previous tweet to show the model
* Note: the animated pictures here are placed separately in a small coordinate system, which is very convenient.
3. When I zoom the image on the right, I want to hide the tools on the left
* this is very simple. In WindowButtonMotionFcn, determine whether the pixel coordinates of the mouse in the x direction of the current window are on the left side (about half of the width of the window). If so, show them, and hide them if not.
* these tools need to be hidden before the model is displayed, because there are no models yet, and you are likely to report errors if you click on them (of course you can use try-catch-end to deal with these errors, but it will be more convenient to hide them). You can set their Visible to off at the beginning, and display these controls as soon as the model is displayed.
4. Since I have removed the toolbar of figure, I can't rotate it, so I need to change the perspective of the coordinate system.
* you can use the view function or the View attribute of the coordinate system, together with two Slider to adjust the azimuth and elevation, so that the rotation is realized indirectly.
* get the current value in the callback of Slider, and then transfer the Value of azimuth and elevation into a vector of 1x2 to the View of the coordinate system, so that each time you move the corresponding Slider, you can turn the model.
5. The model is opaque by default, so you can add a Slider that adjusts transparency
* similar to the fourth one above, you can use the findobj function to find the patch object, and then use set to pass the value of the current Slider to the FaceAlpha property of the patch object.
6. Change the color of gridlines and sheet bodies
* the color of gridlines is controlled by the EdgeColor attribute of patch, and the color of the film body is controlled by the FaceColor attribute of patch.
* this color can be a vector of 1x3, representing R _ Magi _ G _ B, and the value of each element is between 0 and 1, while the actual RGB value is generally between 0 and 255, so divide the input value by 255 to convert it to 0-1.
* the two properties of patch can be modified in the callback of the edit control.
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.