The visualization scene realizes the function of sectioning box, which is simple and easy to use!

Time:2021-11-14

Profiles are often seen in meteorology. The topographic section mainly studies the influence of landform on rainfall and air flow; Latitude altitude profile is mainly used to analyze some conditions of rainfall, such as deep wet layer, upper dry and lower wet, wind direction and speed, etc. In the digital twin visualization scene, the cut plane function is often used to understand the internal structure of the house and facilitate maintenance.
Buildings are entities, and the interior is covered, which makes it difficult for architectural design, building management and equipment maintenance. If you want to understand the complex structure inside the house, you can use the cutting plane for geometric cutting to expose the indoor structure. Thingjs sectioning box function can directly present the sectioning effect in the digital twin visualization scene.
Let’s take a look at the effect of the sectioning box:
The visualization scene realizes the function of sectioning box, which is simple and easy to use!
After adding the cutting box function to the digital twin visualization scene, add the left button, click to display the cutting box, drag and drop each cutting face of the cutting box to correspond to the white model, and you can cut the selected object. Make sure that the custom attribute list of the object that needs top card contains the attributes in the top card information details panel after the example runs.
The visualization scene realizes the function of sectioning box, which is simple and easy to use!
The cutting object involved is the digital twin visual building to be cut. Firstly, query the building and set the building as non pickable, including the internal floors of the building. After the cut action is turned on, a cut bounding box appears around the building, creating more styles based on objects to improve recognition.
1. Create the geometry of the cut bounding box, where the type value can be plane, box, sphere, etc.
2. Set the parent object as the arrow in the cutting direction. Drag the guide arrow to activate the cutting plane.
3. Set cut plane styles, such as color, transparency, two-sided rendering, to appear as bounding boxes.
The complete code is as follows:

//Load scene code 
var app = new THING.App({
 url: 'models/uinnova',
 skyBox: 'BlueSky'
});
 
//Import resource file
THING.Utils.dynamicLoad([
 '/ guide / examples / plugins / cuttingbox / cuttingbox. Min.v0.1.0. JS', // cut box script
],
 function () {
 //Load completion event 
 app.on('load', function (ev) {
 //Set camera position and target point
 app.camera.position = [12.381987189259789, 35.70039578315924, 90.09563419485903];
 app.camera.target = [-31.69618343165883, 4.873235854917229, 14.203971365975518];
 
 //Get the cut object, here select the building in the scene
 var obj = app.query('.Building')[0];
 obj.pickable = false; //  Sets that the building cannot be picked
 obj.floors.visible = true; //  Set the floor display of the building
 obj.renderOrder = 10; //  Sets the rendering order of the building
 //Initializing the sectioning box class
 var cutBoxClass = new CuttingBox({
 object: obj
 })
 //Cut plane display or hide status
 var state = true; 
 
 New then. Widget. Button ('show / hide sectioning box ', function()){
 App. Query ('["object type" = "fire water tank"]'). Visible = false// Hide fire water tank during sectioning
 App. Query ('["object type" = "smoke exhaust fan"]'). Visible = false// Hide smoke exhaust fan during sectioning
 cutBoxClass.showOrHiddenArrow(state); //  Show / hide the sectioning box
 state = !state;
 })
 
 New then. Widget. Button ('reset ', function()){
 //The camera flies to a certain position
 app.camera.flyTo({
 'position': [12.381987189259789, 35.70039578315924, 90.09563419485903],
 'target': [-31.69618343165883, 4.873235854917229, 14.203971365975518],
 'time': 1500,
 'complete': function () {}
 });
 
 App. Query ('["object type" = "fire water tank"]'). Visible = true// Display fire water tank on reset
 App. Query ('["object type" = "smoke exhaust fan"]'). Visible = true// Display smoke exhaust fan on reset
 
 cutBoxClass.resetClippingPlane(); //  Reset sectioning box
 })
 });
 },
 True, // optional, with or without time stamp
 True // optional. Download in order
)

It supports the cutting of any of the five sides of the square box of the model. A rectangular cutting box is generated in the digital twin visual scene view. The model can be cut by long pressing and dragging the mouse in the direction indicated by the arrow. How about it? Is it simple, rough and easy to use!

Recommended Today

Summary of spark conf and config configuration items

1. State configuration item summary of structured streaming Config Name Description Default Value spark.sql.streaming.stateStore.rocksdb.compactOnCommit Whether we perform a range compaction of RocksDB instance for commit operation False spark.sql.streaming.stateStore.rocksdb.blockSizeKB Approximate size in KB of user data packed per block for a RocksDB BlockBasedTable, which is a RocksDB’s default SST file format. 4 spark.sql.streaming.stateStore.rocksdb.blockCacheSizeMB The size capacity […]