mindelec.data.PointCloud

class mindelec.data.PointCloud(data_dir, sampling_config, material_config, num_parallel_workers=os.cpu_count())[source]

Read the stp files to generate PointCloud data, for downstream physical-equation AI simulation. Besides, you can analyse the space topological information for any 3-D model in stp format. (The most popular format in CAD)

Parameters
  • data_dir (str) – stp files directory, raw data

  • sampling_config (PointCloudSamplingConfig) – Sampling space config for PointCloud-Tensor generation.

  • material_config (MaterialConfig) – Material solution config for PointCloud-Tensor generation, which influence the material solving stage.

  • num_parallel_workers (int, option) – Parallel workers number, this arguments can take effect on all computing stages, including reading model, section building, space solving and material solving. Default: os.cpu_count()

Raises
  • TypeError – if data_dir is not a str.

  • TypeError – if sampling_config is not an instance of class PointCloudSamplingConfig.

  • TypeError – if material_config is not an instance of class MaterialConfig.

  • TypeError – if num_parallel_workers is not an int.

Supported Platforms:

Ascend

Examples

>>> import mindelec.data as md
>>> from mindelec.data.pointcloud import SamplingMode, BBoxType, StdPhysicalQuantity
>>> sampling_config = md.PointCloudSamplingConfig(SamplingMode.UPPERBOUND, BBoxType.DYNAMIC, 1000000000,
...                                               (5., 5., 5., 5., 5., 5.))
>>> std_physical_info = {
...                         StdPhysicalQuantity.MU: 1.0,
...                         StdPhysicalQuantity.EPSILON: 1.0,
...                         StdPhysicalQuantity.SIGMA: 0.,
...                         StdPhysicalQuantity.TAND: 0.,
...                     }
>>> material_config = md.MaterialConfig(JSON_FILE, MATERIAL_DIR, std_physical_info, None, True)
>>> pointcloud = md.PointCloud(STP_DIR, sampling_config, material_config)
model_list()[source]

Get model list

Returns

list, model list

tensor_build()[source]

Building pointcloud tensor by using the information obtained in topology_solving module. If poincloud object initialized with material config, all material physical info will be considered. All the results will be stored in a Global list of dictionary, num_of_workers processes in total will be applied in parallel computing.

Returns

numpy.ndarray, pointcloud result

topology_solving()[source]

Solve the topology space by ray-casting algorithm, for each point in sampling space we obtain its sub-model belonging, all the results will be stored in a Global list. num_of_workers processes in total will be applied in parallel computing.