CN105389844A - CPU-based parallel middle axis high-efficiency generation method - Google Patents

CPU-based parallel middle axis high-efficiency generation method Download PDF

Info

Publication number
CN105389844A
CN105389844A CN201510673276.0A CN201510673276A CN105389844A CN 105389844 A CN105389844 A CN 105389844A CN 201510673276 A CN201510673276 A CN 201510673276A CN 105389844 A CN105389844 A CN 105389844A
Authority
CN
China
Prior art keywords
voxel
distance
block
axis
queue
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510673276.0A
Other languages
Chinese (zh)
Inventor
林云峰
刘玉生
胡笑奇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Auspicious Development In Science And Technology Of Literary Composition Co Ltd
Original Assignee
Zhejiang Auspicious Development In Science And Technology Of Literary Composition Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Auspicious Development In Science And Technology Of Literary Composition Co Ltd filed Critical Zhejiang Auspicious Development In Science And Technology Of Literary Composition Co Ltd
Priority to CN201510673276.0A priority Critical patent/CN105389844A/en
Publication of CN105389844A publication Critical patent/CN105389844A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Computer Graphics (AREA)
  • Geometry (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Generation (AREA)

Abstract

The invention discloses a CPU-based parallel middle axis high-efficiency generation method which comprises the following steps of 1) performing voxelization on a three-dimensional model; 2) cutting the three-dimensional model into a plurality of blocks, performing axis calculation in the steps 3)-5) on each block in different CPU processes; 3) initializing a current queue and a reserve queue; 4) traversing the voxel of the current queue, extracting a nearest boundary voxel and surrounding inner voxels of the current voxel, successively updating the distances between the surrounding inner voxels and the nearest boundary voxel; 5) after traversing, if the reserve queue is not empty, performing exchange on the reserve queue and the current queue, setting the summation of an original current distance and the side length as the current distance, and repeating the step 4) until the reserve queue is empty; and 6) combining an acquired axis voxel set. The CPU-based parallel middle axis high-efficiency generation method has advantages of high generation speed, high calculation efficiency and low occupation resource amount.

Description

A kind of parallel axis based on CPU efficiently generates method
Technical field
The present invention relates to field of three-dimension modeling, be specifically related to a kind of parallel axis generation method of three-dimensional model.
Background technology
The axis of two dimensional model refers to its incenter set, and the axis of three-dimensional model then refers to the set of its inscribed sphere centre of sphere.At many engineering fields, the outstanding attribute of axis makes it have great significance, such as finite element analysis, shape analysis, robot path plan, solid modelling and mess generation.
Had the research of many axis generation methods at present, traditional axis generation method can be divided into three classes generally: thin method, tracing and Wei Nuotufa.The method of thinning model is become an approximate model that can easily calculate, and then " reduced " constantly inwards by model until the process that reduces from different directions " is run into " and calculates its axis, the degree of accuracy of calculating is controlled by the approximation accuracy of model; Tracing is a kind of method of recurrence, and it is based on local continuity, generates axis by following the tracks of special axial point; Wei Nuotufa, based on the corresponding relation between Wei Nuotu and De Lao interior triangular, obtains approximately through calculating in Wei Nuotu.But the speed of above-mentioned axis generation method is all very slow, is not all suitable for the complex model with various surface, for the complex model with various surface, goes back the gratifying method of neither one so far and efficiently can generate its axis rapidly.
Summary of the invention
The technical problem to be solved in the present invention is to provide that a kind of formation speed is fast, counting yield is high, the low parallel axis based on CPU that assesses the cost efficiently generates method.
In order to solve the problems of the technologies described above, the technical solution used in the present invention is: a kind of parallel axis based on CPU efficiently generates method, it is characterized in that implementation step is as follows:
1) three-dimensional model is carried out voxel and turn to voxel of object, boundary voxel and outside voxel;
2) three-dimensional model is cut from three coordinate axis, obtain some rectangular parallelepiped blocks.These blocks contain approximately equalised number of voxel;
3) for each block, in the thread of each CPU, initialization current queue and preparation queue, put into current queue by boundary voxel, and in initialization three-dimensional model, the distance to nearest boundary voxel of each boundary voxel is zero, the distance to nearest boundary voxel of each voxel of object is infinity;
4) for each block, in the thread of each CPU, the middle axis information of its local is determined;
5) for all adjacent blocks to such as A, B, travel through the voxel contacted with block B in wherein block A, upgraded the distance of voxel of object to described nearest boundary voxel of block B around it by the voxel distance of block A successively.After this, travel through the voxel contacted with block A in wherein block B, upgraded the distance of voxel of object to described nearest boundary voxel of block A around it by the voxel distance of block B successively.
6) if there is the voxel being updated distance in step 5), initialization current queue in an individual block and preparation queue, be put into current queue by the voxel being updated distance in step 5), after again calculating axis voxel, and go to step 5 by step 4)).If do not upgrade the voxel of distance in step 5), then the axis voxel merging each piece obtains the axis set of voxels generated;
When upgrading each surrounding inner voxel in described step 3) to the distance of nearest boundary voxel, if when surrounding inner voxel is less than former distance to the new distance of the nearest boundary voxel for current voxel, then the distance of this surrounding inner voxel to nearest boundary voxel is upgraded, otherwise keep this surrounding inner voxel constant to the distance of nearest boundary voxel;
Described step 2) in first the bounding box of three-dimensional model carried out according to volume the block cutting into decile as far as possible, then carry out rapid Optimum according to the number of voxel of each block, the number of voxel of each block be close to equal; In described step 7), the final set of voxels of gained is the result of the voxel results added of each piece;
Described step 5) and 6) in can upgrade the distance of adjacent voxels in adjacent block, afterwards further based on boundary voxel upgrade after the range information of range information to block inside upgrade, so repeatedly generate the axis of whole complex model.
The present invention has following advantage:
1, the present invention refers to an approximate representation three-dimensional entity model being changed into some square set of voxels by voxelization, and utilizes current queue and preparation queue two queues, the distance of these voxels to border is carried out spreading renewal.And by these range informations, can judge which is axis voxel by the voxel spread, thus generate axis set of voxels to have that formation speed is fast, counting yield is high, assess the cost low advantage.
2, the present invention is further for the processor with multinuclear, can calculate by parallel processing axis.By model cutting is become block, calculate the axis of each piece respectively, then calculate the impact between each block axis, recalculate the axis of each piece, finally the axis of each piece is merged into result axis.Calculate owing to employing multi-core parallel concurrent process axis, the Time & Space Complexity of algorithm is reduced all greatly, improves the efficiency that axis calculates.
Accompanying drawing explanation
Fig. 1 is the implementing procedure schematic diagram of the embodiment of the present invention.
Fig. 2 is the structural representation of three-dimensional model voxelization in the embodiment of the present invention.
Fig. 3 be connected with current voxel face in the embodiment of the present invention, limit connects, put the surrounding inner voxel schematic diagram that connects.
Fig. 4 is axis voxel determination schematic diagram when two nearest voxels are positioned on same surface in the embodiment of the present invention.
Fig. 5 is axis voxel determination schematic diagram when two nearest voxels are positioned on same concave edge in the embodiment of the present invention.
Fig. 6 is the schematic diagram of parted pattern in the embodiment of the present invention.
Fig. 7 is the detailed process that in the embodiment of the present invention, point axis merges.
Embodiment
As shown in Figure 1, efficiently to generate method implementation step as follows for the parallel axis based on CPU of the invention process:
1) three-dimensional model is carried out voxel and turn to voxel of object, boundary voxel and outside voxel;
2) three-dimensional model is cut from three coordinate axis, obtain some rectangular parallelepiped blocks.These blocks contain approximately equalised number of voxel;
3) for each block, initialization current queue and preparation queue, put into current queue by boundary voxel, and in initialization three-dimensional model, the distance to nearest boundary voxel of each boundary voxel is zero, the distance to nearest boundary voxel of each voxel of object is infinity;
4) the central axis prime information of each block is generated;
5) for all adjacent blocks to such as A, B, travel through the voxel contacted with block B in wherein block A, upgraded the distance of voxel of object to described nearest boundary voxel of block B around it by the voxel distance of block A successively.After this, travel through the voxel contacted with block A in wherein block B, upgraded the distance of voxel of object to described nearest boundary voxel of block A around it by the voxel distance of block B successively.
6) if there is the voxel being updated distance in step 5), initialization current queue in an individual block and preparation queue, be put into current queue, by step 4)-5 by the voxel being updated distance in step 5)) again calculate axis voxel after, and go to step 5).If do not upgrade the voxel of distance in step 5), then the axis voxel merging each piece obtains the axis set of voxels generated.
When upgrading each surrounding inner voxel in described step 3) to the distance of nearest boundary voxel, if when surrounding inner voxel is less than former distance to the new distance of the nearest boundary voxel for current voxel, then the distance of this surrounding inner voxel to nearest boundary voxel is upgraded, otherwise keep this surrounding inner voxel constant to the distance of nearest boundary voxel.
Described step 2) in first according to volume, the bounding box of three bit models is carried out cutting into block, then carry out the fine setting of cutting according to the number of voxel of each block, the number of voxel of each block be close to equal; In described step 7), the final set of voxels of gained is the result of the voxel results added of each piece.
In the present embodiment, the information that each square voxel of body comprises is as shown in the table:
content implication
position mark illustrate this voxel be on model boundary, model is inner or model is outside, is likely the boundary voxel disappeared in Boolean calculation.Be initialized as the outside at model.
nearest boundary voxel it is boundary voxel the shortest to this voxel distance in all boundary voxel.Be initialized as sky.
minimum distance distance between nearest boundary voxel and this voxel.Be initialized as infinity.
axis voxel if a voxel is the nearest boundary voxel of an axis voxel, so the axis voxel of this nearest boundary voxel is exactly this axis voxel
xYZ mark this voxel point other order on coordinate system X/Y/Z axle
voxel marks whether mark a voxel is axis voxel
When obtaining boundary voxel by rays method in outside voxel, the nearest boundary voxel of boundary voxel is itself, and therefore its distance to nearest boundary voxel is 0.
In described step 3), the number of voxel according to model carries out piecemeal to three-dimensional model.Concrete cutting mode as shown in Figure 4, on average cuts into the N block being not more than processor quantity from X-axis, Y-axis, Z axis, the large small size of every block is all identical.Then, cut surface is adjusted, make the voxel of object quantity of each piece be similar to identical.
In the present embodiment, the detailed step obtaining axis set of voxels comprises:
(1) for the thread of each CPU, a voxel in current queue is taken out.Upgrade its all connection after boolean operation, limit connects, point connects voxel of object to the distance (Fig. 3) on border.If the distance to border of surrounding inner voxel meets current distance scope, then put into preparation queue.If two of this voxel nearest boundary voxel belong to different surfaces, and these two surfaces are not connect with concave edge, then this voxel is axis voxel.Repeat this step until current queue is for empty.The method that its middle distance upgrades is: calculate the distance between the nearest boundary voxel of this voxel and this voxel adjacent voxels.If old minimum distance is greater than this distance, then minimum distance is updated to this distance, remembers that this nearest boundary voxel is the nearest boundary voxel of that adjacent voxels.
(2) if preparation queue not empty, then prepare queue and become new current queue, old empty current queue becomes new preparation queue.Current distance equals old current distance and adds the voxel length of side.
(3) travel through all once at the voxel of current queue, if there is a voxel, the nearest boundary voxel of its voxel that at least one limit of nearest boundary voxel and it is connected or face connects does not belong to same, and these two faces are not be connected with concave edge, and so this voxel is axis voxel.
(4) travel through all once at the voxel of current queue, if there is a voxel as shown in Figure 5, two nearest boundary voxel belongs to same, and the normal of this voxel is through its two nearest boundary voxel, and so this voxel is axis voxel.
(5) travel through all once at the voxel of current queue, if there is a voxel as shown in Figure 6, two nearest boundary voxel belongs to concave edge, and the line of this voxel and these two nearest boundary voxel and concave edge tangent, so this voxel is axis voxel.
(6) merge the axis set of voxels of each piece, form the axis set of voxels of results model.As shown in Figure 7.
The foregoing is only the preferred embodiment of the present invention, protection scope of the present invention is not limited in above-mentioned embodiment, and every technical scheme belonging to the principle of the invention all belongs to protection scope of the present invention.For a person skilled in the art, some improvements and modifications of carrying out under the prerequisite not departing from principle of the present invention, these improvements and modifications also should be considered as protection scope of the present invention.

Claims (1)

1. the parallel axis based on CPU efficiently generates a method, it is characterized in that implementation step is as follows:
1) three-dimensional model is carried out voxel and turn to voxel of object, boundary voxel and outside voxel;
2) three-dimensional model is cut from three coordinate axis, obtain some rectangular parallelepiped blocks;
These blocks contain approximately equalised number of voxel;
3) for each block, in the thread of each CPU, initialization current queue and preparation queue, put into current queue by boundary voxel, and in initialization three-dimensional model, the distance to nearest boundary voxel of each boundary voxel is zero, the distance to nearest boundary voxel of each voxel of object is infinity;
4) for each block, in the thread of each CPU, the middle axis information of its local is determined;
5) for all adjacent blocks to such as A, B, travel through the voxel contacted with block B in wherein block A, upgraded the distance of voxel of object to described nearest boundary voxel of block B around it by the voxel distance of block A successively;
After this, travel through the voxel contacted with block A in wherein block B, upgraded the distance of voxel of object to described nearest boundary voxel of block A around it by the voxel distance of block B successively;
6) if there is the voxel being updated distance in step 5), initialization current queue in an individual block and preparation queue, be put into current queue by the voxel being updated distance in step 5), after again calculating axis voxel, and go to step 5 by step 4));
If do not upgrade the voxel of distance in step 5), then the axis voxel merging each piece obtains the axis set of voxels generated;
When upgrading each surrounding inner voxel in described step 3) to the distance of nearest boundary voxel, if when surrounding inner voxel is less than former distance to the new distance of the nearest boundary voxel for current voxel, then the distance of this surrounding inner voxel to nearest boundary voxel is upgraded, otherwise keep this surrounding inner voxel constant to the distance of nearest boundary voxel;
Described step 2) in first the bounding box of three-dimensional model carried out according to volume the block cutting into decile as far as possible, then carry out rapid Optimum according to the number of voxel of each block, the number of voxel of each block be close to equal; In described step 7), the final set of voxels of gained is the result of the voxel results added of each piece;
Described step 5) and 6) in can upgrade the distance of adjacent voxels in adjacent block, afterwards further based on boundary voxel upgrade after the range information of range information to block inside upgrade, so repeatedly generate the axis of whole complex model.
CN201510673276.0A 2015-10-16 2015-10-16 CPU-based parallel middle axis high-efficiency generation method Pending CN105389844A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510673276.0A CN105389844A (en) 2015-10-16 2015-10-16 CPU-based parallel middle axis high-efficiency generation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510673276.0A CN105389844A (en) 2015-10-16 2015-10-16 CPU-based parallel middle axis high-efficiency generation method

Publications (1)

Publication Number Publication Date
CN105389844A true CN105389844A (en) 2016-03-09

Family

ID=55422092

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510673276.0A Pending CN105389844A (en) 2015-10-16 2015-10-16 CPU-based parallel middle axis high-efficiency generation method

Country Status (1)

Country Link
CN (1) CN105389844A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102222360A (en) * 2011-06-17 2011-10-19 浙江大学 Two-queue spread-based constructional method for generating middle axle
US20120078585A1 (en) * 2010-06-29 2012-03-29 University Of Connecticut Method and system for constructing geometric skeletons and medial zones of rigid and non-rigid shapes
CN103279981A (en) * 2013-05-10 2013-09-04 丽水市瑞智科技开发有限公司 Incremental high-efficiency method for generating middle axle

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120078585A1 (en) * 2010-06-29 2012-03-29 University Of Connecticut Method and system for constructing geometric skeletons and medial zones of rigid and non-rigid shapes
CN102222360A (en) * 2011-06-17 2011-10-19 浙江大学 Two-queue spread-based constructional method for generating middle axle
CN103279981A (en) * 2013-05-10 2013-09-04 丽水市瑞智科技开发有限公司 Incremental high-efficiency method for generating middle axle

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
HOUSHENG ZHU ET AL.: "Calculating the medial axis of a CAD model by multi-CPU based parallel computation", 《ADVANCES IN ENGINEERING SOFTWARE 85(2015)》 *
HOUSHENG ZHU ET AL.: "Constructive generation of the medial axis for solid models", 《COMPUTER-AIDED DESIGN》 *
朱厚盛 等: "实体模型的多分辨率中轴生成", 《计算机辅助设计与图形学学报》 *

Similar Documents

Publication Publication Date Title
CN107767457A (en) A kind of STL digital-to-analogue generation methods quickly rebuild based on a cloud
US9581992B2 (en) Method and apparatus for a cutting process automatic generation tool of CAM
JP4381743B2 (en) Method and program for generating volume data from boundary representation data
CN107622530B (en) Efficient and robust triangulation network cutting method
CN110039186B (en) Curved surface model path planning method applied to laser surface etching
CN107972034B (en) Complex workpiece trajectory planning simulation system based on ROS platform
CN113298833A (en) Target object point cloud characteristic line and surface extraction method and system
Dhanik et al. Contour parallel milling tool path generation for arbitrary pocket shape using a fast marching method
CN103279989A (en) Three-dimensional laser imaging system planar point cloud data triangularization processing method
CN110188423A (en) A kind of linear engineering structure fast B IM modeling method based on FEM meshing
Joy et al. Frame-sliced voxel representation: An accurate and memory-efficient modeling method for workpiece geometry in machining simulation
CN110837715A (en) Complex curved surface machining error compensation method based on reverse engineering technology
CN110826122B (en) Voxel method and system for nuclear power three-dimensional layout design model
CN102540976B (en) Entity-based milling simulating method for efficiently extracting cutting angle range
CN115047825A (en) Method for displaying numerical control machining milling in real time
CN104392030B (en) Curved surface machining method based on STL (Standard Template Library) three-dimensional model
CN103810313A (en) Method for converting STL (Standard Template Library) model to space division model
CN105389844A (en) CPU-based parallel middle axis high-efficiency generation method
CN102222360A (en) Two-queue spread-based constructional method for generating middle axle
CN113505424B (en) Interactive construction method for derived component of linear engineering
CN112330679B (en) Numerical control machining-oriented free-form surface segmentation method and system
CN112711231B (en) Method and device for planning additive manufacturing processing path
CN104345686B (en) The two-way dexel blank modeling method of two dimension and machining simulation method thereof
CN105335998A (en) Double-queue spread-based multiresolution middle axle generation method
Huang et al. A matching algorithm between precursory 3D process model and 2D working procedure drawing based on subgraph isomorphism

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20160309

RJ01 Rejection of invention patent application after publication