A kind of 3 D-printing uniform wall thickness based on section file is taken out shell side method
Technical field
The present invention relates to 3 D-printing solid model and take out shell side method, relate in particular to a kind of 3 D-printing uniform wall thickness based on section file and take out shell side method.
Background technology
3 D-printing is the revolutionary technology that of growing up the eighties in 20th century overturns traditional mode of production mode, is again rapid prototyping, increases material manufacture etc.3 D-printing is first by multi-purpose computer Computer Aided Design (CAD) software modeling; Then the model file obtaining is imported to computer-aided manufacturing (CAM) software.In CAM software, model generally need experience the processes such as defect repair, support generation, section generation, and three-dimensional entity model is converted into a series of two dimension slicing output the most at last.Section file including instruct the information of 3 D-printing equipment moving, 3 D-printing equipment read section file and complete print procedure.Section file is laminated in construction direction by a series of face profiles.Every layer of section is made up of some suitable, counterclockwise polygonal profiles again, and these profiles have surrounded the print area on current layer.
The model of input 3 D-printing CAM software is generally expressed as solid entity.On the one hand, when printing, if filled in every one deck slicing profile interscan, inevitable very consuming time, consumptive material; Meeting under the prerequisite of workpiece strength requirement, in order to save time-write interval and material, can take out shell operation to solid model, obtaining the Shell model of master pattern.On the other hand, practical engineering application also has certain demand to Shell model, as investment cast, for fear of burning the shell phenomenon that occurs rising in casting process, conventionally mold prototype is made to shell structure.Further, in investment cast, if mold prototype thickness of shell is inhomogeneous, foundry goods may be damaged because shrink inhomogeneous in solidification process.Therefore, the 3 D-printing take practical engineering application as background is to generate the wall thickness uniform Shell model of trying one's best to taking out shell operation requirement.
The shell side method of taking out of existing 3 D-printing solid model mainly contains three kinds: the one, take out shell for original cad model, and the 2nd, take out shell for section file, the 3rd, take out shell in conjunction with section file and original cad model.
For first method, Lam etc. have proposed a kind of biasing means based on inferior border octree structure and have obtained the reduction model of master pattern, reduction model adds that master pattern is and takes out shell model (referring to Lam TW, Yu KM, Cheung KM, Li CL, Octree reinforced thin-shell rapid prototyping, Journal of Materials Processing Technology, 1997.63 (1 – 3): 784-787).Li etc. by AutoCAD software directly to CSG(constructive solid geometry) solid model of form carries out bias operation, obtain the thin-walled model of master pattern (referring to Li CL, Yu KM, Lam TW, Implementation and evaluation of thin-shell rapid prototype, Computers in Industry, 1998.35 (2): 185-193).The perfect screw rotor difficulty of considering direct calculating three-dimensional model is larger, the propositions such as Koc are transformed into the complicated self intersection problem producing in three-dimension curved surface biasing process in two dimensional surface and eliminate, first they obtain the coarse bias model of master pattern with summit offsetting, then remove to cut this bias model with surface level, in two dimensional surface, eliminate bias cuts the self intersection problem of handing on curve, thereby obtaining perfectly taking out shell cuts into slices (referring to Koc B, Lee YS, Non-uniform offsetting and hollowing objects by using biarcs fitting for rapid prototyping processes, Computers in Industry, 2002.47 (1): 1-23).
For second method, Ganesan etc. have proposed a kind of direct biasing means of the slicing profile representing with nurbs curve, and that obtains original contour curve takes out shell bias curve; But the method is even offset in section, cannot obtain wall thickness at three dimensions and take out uniformly shell model (referring to GanesanM, Fadel GM, Hollowing rapid prototyping parts using offsetting techniques, Proceedings of the Fifth International Conference on Rapid Prototyping, 1994.University of Dayton).
For the third method, the propositions such as Zhang are not equidistantly setovered to two dimension slicing profile, to on profile certain a bit, its offset or dish is determined by the inclined degree of this corresponding dough sheet on original cad model, and provide the computing formula of offset or dish, the method can obtain in theory wall thickness and take out uniformly shell model (referring to Zhang Z, Ding Y, Hong J, A new hollowing process for rapid prototype models, Rapid Prototyping Journal, 2004.10 (3): 166-175).
Known according to above-mentioned document analysis, the weak point that prior art may exist has: one, directly to the cad model dyscalculia of setovering, be difficult for realizing, once and take out shell model and obtain, shell thickness is difficult to revise in printing device; Two, existing less about directly section file being taken out to the document of shell, and only technology is difficult to obtain wall thickness and takes out uniformly shell model.
Summary of the invention
The deficiency existing in directly taking out shell technology for 3 D-printing based on section file in order to solve existing method, the invention provides a kind of 3 D-printing uniform wall thickness based on section file and take out shell side method, the method has considered that in biasing process upper and lower layer slice position take out the impact of shell point position on current layer, therefore can obtain the uniform a series of shell points of taking out of wall thickness.
This method basic thought is the normal direction structure perpendicular at current layer slicing profile, with this perpendicular go cut each related levels slicing profile, obtain one and cut friendship wall line, then in this surface level, this wall line setovered and calculate the intersection point of bias curve and current layer section, taking out shell point thereby obtain.
3 D-printing uniform wall thickness based on section file is taken out a shell side method, comprises the steps:
Step 1, input the section file of model to be printed, and the required thick t of shell wall that takes out; From section file, extract slice thickness value h, shell is taken out in calculating affects number of plies value n
r; T, h, n
rbe the real number that is greater than zero;
Step 2, for i layer section L
ion j outline polygon E
j, to outline polygon E
jon k sampled point P
k, establish sampled point P
kplace's normal vector is n
k, oversampled points P
kalong n
kdirection is made perpendicular α
k; Wherein i, k and j are greater than zero natural number, and i value is less than or equal to total section number of plies, and j is less than or equal to i layer section L
ion outline polygon sum, k is less than or equal to j outline polygon E
jtotal sampling number;
Step 3, use perpendicular α
kremove respectively to cut i layer section L
ibelow with above n
rlayer section, i.e. i-n
rlayer is to i+n
rlayer section, calculates a useful cross in every layer of section; From sampled point P
kstart to connect respectively up or down these useful cross, obtain a wall line C
k;
Step 4, at perpendicular α
kinterior to wall line C
kto n
kthat side of indication is setovered, and offset or dish is t, obtains wall line C
kbiasing wall line
wherein t is greater than zero real number;
Step 5, calculating biasing wall line
intersection point H with i layer surface level
k, intersection point H
kfor sampled point P
kthe corresponding shell point of taking out; By intersection point H
kbe added into outline polygon E
jthe corresponding shell polygon of taking out
upgrade k value, skip to step 2 until E
jupper all sampled points are traversed; Wherein i layer surface level is i layer section L
ithe plane at place; If intersection point H
kdo not exist, directly upgrade k value, skip to step 2 until E
jupper all sampled points are traversed;
What step 6, elimination obtained above takes out shell polygon
on self intersection ring, and adjust and take out shell polygon
direction makes itself and outline polygon E
jopposite direction; To take out shell polygon
be added into current i layer section L
iin; Upgrade j value, skip to step 2 until all original contour polygons of current layer are traversed;
Step 7, upgrade i value, skip to step 2 until in the file of cutting into slices all sections be traversed; Output uniform wall thickness take out shell section file.
Input of taking out shell side method of the present invention is only section file, and does not comprise cad file or the information of any master pattern; In declarative procedure of the present invention, think section file in each layer cut into slices along continuous straight runs, take out shell basic skills for adopting perpendicular to cut friendship to each dropping cut slice, one that obtains on perpendicular inner model wall is cut friendship wall line, then in perpendicular, this wall line biasing is obtained accurately taking out shell wall thickness value.
Further, in described step 1, the section file of input is laminated by the profile of a series of along continuous straight runs; Every layer of section comprises again some outline polygons, wherein counterclockwise outline polygon presentation-entity outer boundary, clockwise outline polygon presentation-entity inner boundary.In step 1, while extracting slice thickness value h: if the field that comprises slice thickness in section file reads this field and obtains slicing layer thickness value h; If do not comprise this field in section file, get two adjacent layer height values and subtract each other and obtain one-tenth-value thickness 1/10 h.
I layer section taken out in shell process, the slicing profile in the above or following certain limit of i layer section is taken out hull shape shape to this layer all can impact, and this takes out shell affects number of plies value n
rthe thick t of shell wall and slice thickness h are relevant with taking out.So, as preferably, in step 1, calculate and take out shell and affect number of plies value n by following formula (1)
r:
n
r=t/h+1 (1)。
As preferably, in step 2, described outline polygon E
jup-sampling point P
kthe n of place
kspecifically ask method as follows:
(1) if sampled point P
kbe positioned at outline polygon E
jsummit on:
As outline polygon E
jdirection be counterclockwise, corresponding n
kdirection is along outline polygon E
jat sampled point P
kthe interior angular bisector setting at place;
As outline polygon E
jdirection be clockwise, corresponding n
kdirection is along outline polygon E
jat sampled point P
kplace's exterior angle bisector setting;
(2) if sampled point P
kbe positioned at outline polygon E
jcertain limit on:
As outline polygon E
jdirection be counterclockwise, corresponding n
kdirection arranges in the direction of and sensing polygon inner side vertical with this limit;
As outline polygon E
jdirection be clockwise, corresponding n
kdirection arranges in the direction in and sensing polygon outside vertical with this limit.No matter be above which kind of situation, n
kall the time in horizontal plane.
Further, in described step 3, using perpendicular α
kremove to cut certain one deck dropping cut slice L
q(q ∈ [i-n
r, i+n
r]) on outline polygon time, may have multiple intersection points, but useful cross only has one.In step 3, using perpendicular α
kwhile going to cut the outline polygon in certain one deck section, if there are multiple intersection points, needing to choose an intersection point is useful cross; The method of choosing useful cross from multiple intersection points is as follows: by each intersection point obtaining in the surface level of current slice along n
kdirection sorts, and finds out and is positioned at n
kthe intersection point of caudal end is useful cross.To the section of i layer, its useful cross is P
k.
In step 3, described perpendicular α
kalso may not there is not any intersection point with the outline polygon in certain one deck section, now more artificially at perpendicular α
kwith on the intersection of this layer of section along n
ka point of forward infinite point structure, and this point is added into wall line C
k; If this layer section is at i layer section L
itop, wall line C
kupwards stop growing, no longer detect more than this layer of section section and perpendicular α
kcrossing situation; Otherwise wall line C
kstop growing downwards.
Further, can be referring to method in existing document to the biasing of space wall line in described step 4, but require to guarantee the situation without self intersection on the offset line of output.
As preferably, in step 6, eliminate and take out shell polygon
on the self intersection ring FLTM method that uses Lai etc. to propose.The method can be transformed into two-dimentional plane polygon self intersection problem on one dimension number axis and analyze, simplify the processing procedure of self intersection, efficiency is higher (referring to Lai YL, Wu JSS, Hung JP, hen JH, A simple method for invalid loops removal of planar offset curves, The International Journal of Advanced Manufacturing Technology, 2006.27 (11): 1153-1162).
In step 6, take out shell polygon having eliminated
on self intersection ring after, if take out shell polygon
split into multiple sub-polygons, adjust the polygonal direction of every height and original contour polygon E
jopposite direction, if i.e.: outline polygon E
jfor counterclockwise, adjust sub polygonal direction for clockwise; If outline polygon E
jfor clockwise, adjust sub-polygon direction for counterclockwise, then will after adjustment, take out shell polygon
add current i layer section L to
iin, as new outline polygon.
Further, described at current layer i layer section L
iupper all original contour polygons are taken out to shell operation after, the region that needs scanning on current layer is by original contour polygon and take out shell polygon and jointly surround, wherein For Polygons Representation entity outer boundary, clockwise For Polygons Representation entity inner boundary counterclockwise.
A kind of 3 D-printing uniform wall thickness based on section file of the present invention is taken out shell side method, and the useful effect having is:
Current slice consistency profiles is setovered to wall line, can obtain wall thickness and take out uniformly shell polygonal profile; Directly section file is taken out to shell, do not relate to any information of original cad model, therefore can in printing device, arrange or revise and take out shell wall thickness value, simple to operate, controllability be strong.
Accompanying drawing explanation
Fig. 1 is that the 3 D-printing uniform wall thickness that the present invention is based on section file is taken out shell method flow diagram.
Fig. 2 (a) is a simple sphere model in embodiment of the present invention part.
Fig. 2 (b) is the section file of the sphere model shown in Fig. 2 (a).
Fig. 3 is outline polygon up-sampling point P
knormal direction n
ktwo kinds of situations while solving, sampled point P in Fig. 3 (a)
kat the summit place of outline polygon; In Fig. 3 (b), sampled point P
kon a limit of outline polygon.
Fig. 4 is that embodiment of the present invention part is according to the perpendicular α of sampled point structure
kand cut and hand over the wall line C obtaining
k.
Fig. 5 is perpendicular α
kwhile cutting friendship with horizontal cutting layer outline polygon, useful cross is asked method, and Fig. 5 (a) is for existing the situation of two intersection points, and Fig. 5 (b) is for existing the situation of multiple intersection points.
Fig. 6 setover wall line and take out shell point calculate.
Fig. 7 cuts layer go up by original polygon and take out the shell area that shell polygon surrounds.
Fig. 8 takes out shell result uniformly to spheroid section file wall thickness in example.
Embodiment
Below in conjunction with drawings and Examples, technical solution of the present invention is described in further details, following examples do not form limitation of the invention.
The present invention is based on process flow diagram that the 3 D-printing uniform wall thickness of section file takes out shell side method as shown in Figure 1, concrete implementation step is as follows:
Step 101, input the section file of model to be printed, and the required thick t of shell wall that takes out; From section file, extract slice thickness value h, shell is taken out in calculating affects number of plies value n
r=t/h+1.T, h, n
rbe the real number that is greater than zero.
The section file of input generates in 3 D-printing CAM software (as Magics RP), is laminated, as shown in Figure 2 by the profile of a series of along continuous straight runs; Fig. 2 (a) is a simple sphere model, and Fig. 2 (b) is section file corresponding to this spherical model.Every layer of section in section file in Fig. 2 (b) comprises again some outline polygons, wherein counterclockwise profile presentation-entity outer boundary, clockwise profile presentation-entity inner boundary.In the section file of input, generally comprise the field of slice thickness, read this field and obtain slicing layer thickness value h; If do not comprise this field in section file, get two adjacent layer height values and subtract each other and obtain one-tenth-value thickness 1/10 h, as shown in Figure 2, to i layer section take out in shell process, the slicing profile more than section of i layer or in following certain limit is taken out hull shape shape to this layer all can have impact, this number of plies value range n
rthe thick t of shell wall and slice thickness h are relevant with taking out, and physical relationship formula is: n
r=t/h+1.
Step 102, for i layer section L
ion j outline polygon E
j; To outline polygon E
jon sampled point P
k, establish sampled point P
kplace's normal vector is n
k, oversampled points P
kalong n
kdirection is made perpendicular α
k.Wherein i, k and j are greater than zero natural number, and i value is less than or equal to total section number of plies, and j is less than or equal to i layer section L
ion outline polygon sum, k is less than or equal to j outline polygon E
jtotal sampling number.
For the purpose of simple, to i layer section L
ion outline polygon E
jpress apart from uniform sampling any one sampled point P
kthe normal vector n of place
kspecifically ask method as follows: (1) is as shown in Fig. 3 (a), if sampled point P
kjust be positioned at outline polygon E
jsummit on, corresponding n
kdirection is along outline polygon E
jat sampled point P
kinterior angular bisector (the outline polygon E at angle, place
jdirection be counterclockwise) or exterior angle bisector (outline polygon E
jdirection be clockwise); (2) as shown in Figure 3 (b), if sampled point P
kbe positioned at outline polygon E
jcertain limit on, corresponding n
kdirection is along and sensing polygon inner side (outline polygon E vertical with this limit
jdirection be counterclockwise) or outside (outline polygon E
jdirection be clockwise) direction on.No matter be above which kind of situation, n
kall the time in horizontal plane.Fig. 4 has provided according to sampled point P
kand vector n
kthe perpendicular α constructing
k402.
Step 103, use perpendicular α
kgo respectively to cut below the section of i layer and above n
rlayer section, i.e. i-n
rlayer is to i+n
rlayer section, calculates a useful cross in every layer of section; From P
kstart to connect respectively up or down these useful cross, obtain a wall line C
k401.
The wall line C obtaining as stated above
kas shown in Figure 4.It should be noted that and using perpendicular α
kremove to cut certain one deck dropping cut slice L
q(q ∈ [i-n
r, i+n
r]) on outline polygon time, may have multiple intersection points, but useful cross only has one.Fig. 5 has provided XY graphic memory and has chosen example at the useful cross of two or more intersection points, Fig. 5 (a) for intersection point be the situation of two, Fig. 5 (b) for intersection point be the situation of four, the concrete grammar that wherein available point is chosen is as follows: by each intersection point obtaining in current slice surface level along vector n
kdirection sorts, and finding out the intersection point that is positioned at vectorial caudal end is useful cross, obtains the available point 501 in Fig. 5 (a) and Fig. 5 (b).To the section of i layer, its useful cross is P
k.
Perpendicular α described above
kwith dropping cut slice L
qon outline polygon also may not there is not any intersection point, now more artificially at perpendicular α
kwith dropping cut slice L
qintersection on along n
ka point of forward infinite point structure, and this point is added into wall line C
k.If dropping cut slice L
qat i layer section L
itop, wall line C
kupwards stop growing, i.e. detection level section L no longer
qabove surface level and perpendicular α
kcrossing situation; Otherwise wall line C
kstop growing downwards.
Because shell need not be taken out in top and the bottom of model, so while finding available point, for the layer that approaches top (bottom), if inadequate n
rlayer, calculates according to the number of plies of in esse section so, finally obtains wall line.
Step 104, at perpendicular α
kinterior to wall line C
kto vector n
kthat side of indication is setovered, and offset or dish is t, obtains C
kbiasing wall line
Can be referring to method in existing document to the biasing of space wall line, but require to guarantee the situation without self intersection on the offset line of output, and biasing efficiency requires high as far as possible.In the present embodiment, the biasing of space curve is used the PWID method of the propositions such as Choi, the method can approach in linear session output without the offset line of self intersection (referring to Choi BK, Park SC, A Pair-Wise Offset Algorithm for2d Point-Sequence Curve, Computer-Aided Design, 31 (1999): 735-745.).Fig. 6 has provided at perpendicular α
kinterior many walls line C
kthe result of offset or dish t.
Step 105, calculating biasing wall line
with i layer surface level (i layer section L
ithe plane at place) intersection point H
k, H
kfor P
kthe corresponding shell point of taking out; By H
kbe added into outline polygon E
jthe corresponding shell polygon of taking out
k++(upgrades k value, can adopt the mode increasing progressively or successively decrease to upgrade, 0 < k≤M, and M is outline polygon E
jthe sum of up-sampling point), skip to
step 102 until outline polygon E
jabove be traversed a little.
As shown in Figure 6, H
kfor the intersection point of biasing wall line and present level face, i.e. P
kthe corresponding shell point of taking out.It should be noted that biasing wall line
intersection point H with i layer surface level
kmay exist, also may not exist.If H
kexist, by H
kbe added into and take out shell polygon
otherwise directly k++, skips to step 102.
What
step 106, elimination obtained above takes out shell polygon
on self intersection ring, and adjust
direction makes itself and E
jopposite direction; Will
be added into current slice L
iin; J++(upgrades j value, can adopt the mode increasing progressively or successively decrease to upgrade, 0 < j≤P, and P is i layer section L
ithe sum of upper outline polygon), skip to step 102 until all original contour polygons of current layer are traversed.
Shell polygon is taken out in elimination
on the self intersection ring FLTM method that uses Lai etc. to propose, the method can be transformed into two-dimentional plane polygon self intersection problem on one dimension number axis and analyze, simplify the processing procedure of self intersection, efficiency is higher (referring to Lai YL, Wu JSS, Hung JP, Chen JH, A simple method for invalid loops removal of planar offset curves, The International Journal of Advanced Manufacturing Technology, 2006.27 (11): 1153-1162).
As shown in Figure 7, take out shell polygon having eliminated
on self intersection ring after, take out shell polygon
multiple sub-polygons be may split into, the polygonal direction of every height and original polygon E adjusted
jopposite direction.Particularly, if take out shell polygon E
jfor counterclockwise, adjust and take out shell polygon
direction is clockwise; If take out shell polygon E
jfor clockwise, adjust and take out shell polygon
direction is counterclockwise.Then will
add current slice layer L to
iin, as new outline polygon.
Step 107, i++(upgrade i value, can adopt the mode increasing progressively or successively decrease to upgrade, and 0 < i≤O, O is the sum that section is cut into slices in file), skip to step 102 until in section file all sections be traversed; Output uniform wall thickness take out shell section file.
As shown in Figure 7, at current layer L
iupper all original contour polygons are taken out to shell operation after, the region that needs scanning on current layer is by original contour polygon and take out shell polygon and jointly surround, wherein For Polygons Representation entity outer boundary, clockwise For Polygons Representation entity inner boundary counterclockwise.
A typical embodiment of the present invention is as follows:
1. the part to be printed of selecting in this example, for sphere model, is cut into slices file as shown in Figure 1.This sphere model radius is about 50mm, slice thickness h=0.5mm.
2. above-mentioned section file is imported in the test procedure of writing by the inventive method with C Plus Plus, in test procedure, arrange and take out the thick t=5mm of shell wall, affect number of plies value n
r=5/0.5+1=11, need consider respectively 11 layers (model low side and top exceptions) up and down when calculating current layer and taking out shell polygon.
Fig. 8 has provided above-mentioned spheroid section file has been taken out to shell result.As shown in Figure 8, no matter, on that height, how model degree of crook changes, and takes out shell model 802(dark color) and master pattern 801(light color) between spacing even, take out shell wall thick evenly.This example has illustrated that the inventive method has certain practicality.
The above is only the preferred embodiment of the present invention, it should be pointed out that the those skilled in the art for the art, and the present invention can also have various modifications and variations.Under the premise without departing from the principles of the invention, any modification of doing, be equal to replacement, improvement etc., within protection scope of the present invention all should be included in.