A method for equidistant offset of trajectories on free-form surfaces based on a CAD engine
By using an interface and computational method based on a CAD engine, the compatibility problem between trajectory generation software and CAD engine was solved, and efficient generation of equidistant offset trajectories on freeform surfaces was achieved, which is suitable for multi-layer trajectory planning in wire laying trajectory generation software.
Patent Information
- Application Number
- CN202410926433.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-11
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2044-07-11
AI Technical Summary
In existing technologies, trajectory offset methods based on CAD engines are not well compatible with the functions of CAD engines and cannot directly output the parametric equations of freeform surfaces, which makes it difficult to develop trajectory generation software.
Using a CAD engine-based interface, trajectory offset is achieved through point-to-surface projection, finding the surface normal vector of points on the surface, fitting spline curves to points, and vector operations. The specific steps include calculating the bandwidth direction vector, projection, angle calculation, and arc length determination. Combined with boundary constraints and error control, an equidistant offset trajectory is generated.
It achieves high compatibility between trajectory generation software and CAD engine, enabling multi-layer trajectory planning without manipulating the mold model surface, thus simplifying the trajectory generation process.
Smart Images

Figure CN118897509B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of trajectory planning, and particularly relates to a method for equidistantly offsetting a trajectory on a free-form surface based on a CAD engine. BACKGROUND
[0002] Laying trajectory planning refers to pre-planning a laying path to control the movement of a laying head on a laying surface. On a laying surface, a plurality of fiber filaments need to be closely arranged and laid to achieve full coverage of the laying surface. Since the width of the fiber filaments is fixed, the laying trajectories of the plurality of fiber filaments on the same laying surface are obtained by equidistantly offsetting a basic trajectory along the laying surface.
[0003] For a model in the igs file format, the existing laying trajectory is formed by the following process: based on the parametric equation of the free-form surface, the points on the trajectory are offset point by point by using the method of solving differential equations, and then connected to become the next trajectory.
[0004] The CAD engine has interfaces such as model display, Boolean operation and projection, and is suitable for the development of trajectory generation software. The source codes of commonly used CAD engines such as Opencascade and ACIS are in C++ version, and the algorithm for solving differential equations is complex in C++. At the same time, the CAD engine cannot directly output the parametric equation of the free-form surface.
[0005] In summary, the existing trajectory offset method is not highly adaptable to the functions provided by the CAD engine, which is not conducive to software development. SUMMARY
[0006] In view of the above problems, the application provides a method for equidistantly offsetting a trajectory on a free-form surface based on a CAD engine, which only relies on the interfaces of "point projection on a surface", "surface normal vector lookup of a point on a surface", "point fitting spline curve", "curve discrete point" and vector operation provided by the CAD engine, and the trajectory offset can be realized.
[0007] The method for equidistantly offsetting a trajectory on a free-form surface based on a CAD engine comprises the following specific steps:
[0008] Step 1: selecting a trajectory point by point for a basic trajectory composed of trajectory points, or a basic trajectory composed of trajectory points obtained by discretizing a curve trajectory;
[0009] Step 2: calculating the bandwidth direction vector of the Kth trajectory point P K of the basic trajectory
[0010]
[0011] wherein K is initially 1; P KThe tangent vector on the base trajectory, The face normal vector of the trajectory point P K .
[0012] Step three, the trajectory point P K is translated along its bandwidth direction by a length of Wide, obtaining an intermediate trajectory point P0;
[0013]
[0014] Wide is the step length, and the initial value is a fiber width W.
[0015] Step four, the intermediate trajectory point P0 is projected to the laying surface, obtaining the trajectory point P′ K corresponding to the same position of the base trajectory of the first offset trajectory;
[0016] Step five, the face normal vector of the trajectory point P′ K is queried by a class function, and the included angle θ between the face normal vector and is calculated;
[0017] Step six, the arc length distance of the two trajectory points P K and P′ K on the laying surface is calculated by using the included angle θ;
[0018]
[0019] Step seven, the theoretical distance L of the arc length is calculated: L = W-hθ
[0020] h is the distance from the laying surface to the input mold surface, i.e. the layer thickness;
[0021] Step eight, it is judged whether the arc length distance of the trajectory points P K and P′ K on the laying surface reaches the theoretical value L, i.e. whether it satisfies If yes, the trajectory point P′ K is output; step nine is entered, otherwise, the step length Wide is updated as (W-hθ) / θ*tanθ, and step three is returned;
[0022] Step nine, the point P′ K of the first offset trajectory is obtained, K = K+1 is updated, and the above steps are repeated point by point for the base trajectory, so that all offset points on the first offset trajectory can be obtained through the base trajectory;
[0023] Step ten, all offset points are fitted as a spline curve, and after boundary limitation, the spline curve is discretized into trajectory points based on the allowable error value.
[0024] The boundary limit is specifically: for the first and last offset points, when the first / last offset point is in the boundary, the points are calculated in the given step along the direction outside the default range until the point outside the boundary is calculated, and the two points inside and outside the boundary are obtained by bisection to obtain the point on the boundary as the final trajectory point;
[0025] When the first / last offset point is outside the boundary, the points are calculated in the given step along the direction inside the default range until the point inside the boundary is calculated, and the two points inside and outside the boundary are obtained by bisection to obtain the point on the boundary as the final point.
[0026] The two final points and all the offset points between them are counted into an array, which is the trajectory point array of the trajectory.
[0027] Step eleven, taking the first offset trajectory as the base trajectory, repeating steps two to ten to obtain all trajectory points on the free-form surface offset by equal distances;
[0028] When the array length of the current trajectory is 0, it means that the fiber trajectory has been offset to the outside of the laying area, and this trajectory is not recorded, and the cycle is ended, that is, all trajectory points on the free-form surface offset by equal distances are obtained.
[0029] The advantages of the present application are:
[0030] 1. The trajectory equal-distance offset method on the free-form surface based on the CAD engine avoids differential equations, is more suitable for the interface provided by the CAD engine, and is suitable for the implementation of the fiber laying trajectory generation software.
[0031] 2. The trajectory equal-distance offset method on the free-form surface based on the CAD engine can complete multi-layer trajectory planning based on the mold model, and does not need to operate the mold model surface when calculating the trajectory of the laying layer with a layer thickness. BRIEF DESCRIPTION OF DRAWINGS
[0032] Figure 1 is a flowchart of the trajectory equal-distance offset method on the free-form surface based on the CAD engine of the present application;
[0033] Figure 2 is a flowchart of the trajectory equal-distance offset method on the free-form surface based on the CAD engine of the present application;
[0034] Figure 3 is a schematic diagram of the single-point trajectory offset method adopted by the present application. DETAILED DESCRIPTION
[0035] The present application will be further described in detail below with reference to the accompanying drawings and embodiments.
[0036] The present application provides a trajectory equal-distance offset method on a free-form surface based on a CAD engine, as shown in Figure 1As shown, the specific steps are:
[0037] Step 1: For a basic trajectory composed of trajectory points, or a basic trajectory composed of trajectory points obtained by discretizing a curve trajectory, select trajectory points one by one;
[0038] If a curve is selected, the trajectory is discretized into trajectory points (which can be implemented by calling the GCPnts_QuasiUniformDeflection class of the Opencascade engine).
[0039] Step 2: For the Kth trajectory point P of the basic trajectory K , calculate the bandwidth direction vector of the point
[0040]
[0041] Among them, the initial value of K is 1; is the trajectory point P K The tangent vector on the base trajectory, is the trajectory point P K The face normal vector.
[0042] Step 3: Set the trajectory point P K Translate the Wide length along its bandwidth direction to obtain the middle trajectory point P0;
[0043]
[0044] Wide is the step size, and the initial value is a fiber width W.
[0045] Step 4: Project the intermediate track point P0 onto the laying surface to obtain the track point P′ of the first offset track corresponding to the same position of the basic track. K ;
[0046] Step 5: Query the trajectory point P′ through the class function K The face normal vector And calculate the face normal vector and The angle θ;
[0047]
[0048] Step 6. Calculate two trajectory points P using the angle θ K and P′ K Arc length distance on the laying surface;
[0049]
[0050] Step 7: Calculate arc length The theoretical distance L;
[0051] L=W-hθ
[0052] h is the distance between the laying surface and the input mold surface, i.e. the layer thickness;
[0053] Step 8: Determine trajectory point P K and P′ K Whether the arc length on the laying surface reaches the theoretical value L, that is, whether it satisfies If yes, then output the trajectory point P′ K ; Go to step 9, otherwise, update the step size Wide = (W-hθ) / θ*tanθ, and return to step 3;
[0054] Step 9: Obtain the point P' of the first offset trajectory K , update K = K + 1, repeat the above steps point by point on the basic trajectory, and all the offset points on the first offset trajectory can be obtained through the basic trajectory;
[0055] Step 10: Fit the offset points into a spline curve, and after boundary restriction, discretize them into trajectory points based on the allowable error value.
[0056] A spline curve is an equation based on a parameter t, which defaults to the range [0, 1].
[0057] The boundary restriction method is as follows: for the first and last offset points, when the first / last offset point is within the boundary, the points are calculated point by point along the direction outside the default range according to the given step size until the point outside the boundary is calculated. The two points inside and outside the boundary are obtained by bisection to obtain the point on the boundary as the final trajectory point; if the point t=0 is within the boundary and the step size is 0.1, the points t=-0.1 and t=-0.2 are calculated.
[0058] When the first / last offset point is outside the boundary, the calculation is performed point by point along the direction within the default range at a given step size until a point within the boundary is calculated. The two points inside and outside the boundary are bisectioned to obtain the point on the boundary as the final point; for example, if the point t=0 is within the boundary and the step size is 0.1, the points at t=0.1 and t=0.2 are calculated.
[0059] The final points on both sides and all the offset points between them are counted into an array one by one. This array is the trajectory point array of this trajectory.
[0060] Step 11: Use the first offset trajectory as the basic trajectory and repeat steps 2 to 10 to obtain all trajectory points of equidistant offset on the free surface.
[0061] The cutoff condition for the offset is: the length of the trajectory point array obtained in step 10 is 0. At this time, the trajectory has been offset outside the placement area and this trajectory is not recorded.
[0062] Example:
[0063] As Figure 2 shown, the specific process is:
[0064] S100: the user inputs an initial trajectory C0 and discretizes it into a 0th trajectory point set P0{n} with normal vector N and tangent vector t; K = 0;
[0065] S110: input the Kth trajectory point set P K {n} with normal vector N and tangent vector t; i = 0;
[0066] S120: offset the point set P K {n} point by point by the "single-point trajectory offset method" to calculate the trajectory point set P K+1 {n} on the K+1th trajectory;
[0067] S130: fit the point set P K+1 {n} into a spline curve C K+1 , and then perform boundary restriction;
[0068] S140: discretize C K+1 and the laying surface into the K+1th trajectory point set P K+1 {n} with normal vector N and tangent vector t, and the trajectory point set P K+1 {n} obtained at this time is the real trajectory point of this trajectory;
[0069] S150: if there is a point in the point set P K+1 {n}, K = K+1, jump to S110 to calculate the next trajectory; otherwise, it is indicated that this trajectory has exceeded the boundary, and the first K trajectories are output as the laying trajectories of the laying surface.
[0070] Figure 3 As shown in the schematic diagram of the "single-point trajectory offset method" described in S120, P1 is a known point, and P2 is an offset point, and the steps are as follows:
[0071] Step S200: calculate the bandwidth direction of P1 as the tangent vector of P1 on the trajectory, and the face normal vector of P1.
[0072] Step S210: translate P1 along its bandwidth by a length of Wide, and Wide is initially a fiber width W to obtain
[0073] Step S220: project P1' to the laying surface to obtain P2;
[0074] Step S230: query the face normal vector of P2.
[0075] Step S240: calculate the angle θ between P1 and P2;
[0076] Step S250: calculate the arc length distance of P1 and P2 on the laying surface
[0077] Step S260: calculate the theoretical distance L of the arc length L = W - hθ.
[0078] Step S270: if then output P2; otherwise Wide = (W - hθ) / θ * tanθ, return to step S210.
Claims
1. A method for equidistant offset of a trajectory on a freeform surface based on a CAD engine, characterized in that, The specific steps are as follows: Step one, for the base track of fiber filament laying, select track points one by one, for the Kth track point P K , calculate the bandwidth direction vector of this point wherein K initial value is 1 ; is the tangent vector at the trajectory point P K is the tangent vector at the trajectory point P is the tangent vector at the trajectory point P K is the tangent vector at the trajectory point P Step two, translate the track point P K along its bandwidth direction by Wide to get the intermediate track point P0; Step three, project the intermediate track point P0 to the laid surface to obtain the track point P' corresponding to the same position of the first offset track K ; Step four, query the trajectory point P' by class function K The face normal vector of And calculate the angle θ between the face normal vector And Thus, the arc length distance of two trajectory points P K And P' K On the laying surface Step five, calculate the arc length Theoretical distance L: L = W - hθ h is the distance from the laying surface to the input mold surface, i.e., the layer thickness; W is the fiber width; Step six, judge whether the arc length distance reaches the theoretical value L, if yes, output the track point P' K ; enter step seven, otherwise, update the step length Wide, return to step two; Step seven, the point P' of the first offset track is obtained K , update K=K+1, repeat the above steps point by point to obtain all offset points on the first offset track through the base track. Step eight, fitting all offset points into a spline curve, after boundary restriction, discretizing into trajectory points based on the allowable error value; Step nine, taking the first offset trajectory as the basic trajectory, repeating the above steps to obtain all trajectory points on the free-form surface.
2. A method for lofting equidistant offsets on a freeform surface based on a CAD engine as recited in claim 1, wherein, The intermediate trajectory point P0 is calculated as follows: Wide is the step length, and the initial value is one fiber width W.
3. A method for lofting equidistant offsets on a freeform surface based on a CAD engine as recited in claim 1, wherein, The face normal vector and The angle θ is calculated as follows:
4. A method for lofting an isometric offset of a trajectory on a freeform surface based on a CAD engine as recited in claim 1, wherein, The update step formula is Wide = (W - hθ) / θ*tanθ.
5. A method for lofting equidistant offsets on a freeform surface based on a CAD engine as recited in claim 1, wherein, The boundary restriction is as follows: for the first and last offset points, when the first / last offset point is in the boundary, the point is calculated in the direction outside the default range according to the given step length until the point outside the boundary is calculated, and the two points inside and outside the boundary are obtained through the dichotomy to obtain the point on the boundary as the final trajectory point; When the first / last offset point is outside the boundary, the point is calculated in the direction inside the default range according to the given step length until the point inside the boundary is calculated, and the two points inside and outside the boundary are obtained through the dichotomy to obtain the point on the boundary as the final point; The two final points and all the offset points between them are counted into an array, and the array is the trajectory point array of the trajectory.
Citation Information
Patent Citations
Large-width strip laying trajectory planning algorithm
CN116187125A
Curved-surface variable-bandwidth automatic fiber placement forming trajectory planning design method and storage medium thereof
CN117238414A