0

Script - Slicing method for wireframe volume estimation

Pavel Yakovlev (Moderator (RUS)) 8 years ago in Scripting 0
Good whatever time of the day it is where you are!

This post is dedicated to wireframe volume estimation by slicing method which sometimes is used for it. This script works when a slicing plane contains only one wireframe section. It means that there is no section where wireframe can be splitted.

The script window, that can be a little bit confusing, is below:

Image 658

The script window has three tabs. The first one is Input where you have to choose tridb file and wireframe name. This is easy. The second tab is Slicing Planes:

Image 659

This tab looks similar to Slicing Planes tab of Wireframe\Operations\Slice function. You can specify here plane direction, reference point and other plane definitions here. Compulsory fields are highlighted in red color. Double mouse click on X, Y, Z fields will insert boundary coordinates of the wireframe. The last tab is Output:

Image 660

You can find here four possible variants of the output file:
  1. HTML report is a report, where summary table and sections are.
  2. RPT report is a standard Micromine report file, where summary table is.
  3. Original STR file of sections is a result of slicing
  4. Rotated STR file of sections is a STR file of rotated sections which are located in origin of coordinates
It's possible to add an export to PDF file instead of HTML but I chose HTML because of its appearance. Here you can download an example of HTML report. Matplotib module is required for creating HTML reports (links for downloading are in the end of the post). If you don't have matplotlib installed, HTML report function will be disabled.

Algorithm of the script is based on two formulas:
  1. Image
  2. Image
where S1 and S2 - areas of neighbouring sections, l - a distance between them. The second formula is used when sections differ by more than 40%.

The script wasn't tested enough so I appreciate any feedback about errors or the way it works.
P.S.: Script works in Micromine 2014

Download script here: GUI - Slicing method.py

Links for downloading matplotlib:

Before running the script on your machine, ensure that you have Python installed because it uses Tkinter module that is not built in Micromine. You can download Python using one of the following links:
  • Micromine 2014 32bit – download Python here.
  • Micromine 2014 64bit – download Python here.
Important
  • Not recommended to install several versions of Python on one machine
  • Restart Micromine when instalation process is finished.
If you have any problems, feel free to ask