CN106898028A - A kind of segmental arc polygon two dimension boolean operation method - Google Patents

A kind of segmental arc polygon two dimension boolean operation method Download PDF

Info

Publication number
CN106898028A
CN106898028A CN201710035970.9A CN201710035970A CN106898028A CN 106898028 A CN106898028 A CN 106898028A CN 201710035970 A CN201710035970 A CN 201710035970A CN 106898028 A CN106898028 A CN 106898028A
Authority
CN
China
Prior art keywords
sub
main body
island
polygon
hole
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
CN201710035970.9A
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.)
SHENZHEN PCB PARTNER INFORMATION TECHNOLOGY Co Ltd
Original Assignee
SHENZHEN PCB PARTNER INFORMATION TECHNOLOGY 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 SHENZHEN PCB PARTNER INFORMATION TECHNOLOGY Co Ltd filed Critical SHENZHEN PCB PARTNER INFORMATION TECHNOLOGY Co Ltd
Priority to CN201710035970.9A priority Critical patent/CN106898028A/en
Publication of CN106898028A publication Critical patent/CN106898028A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2210/00Indexing scheme for image generation or computer graphics
    • G06T2210/12Bounding box

Abstract

The present invention provides a kind of segmental arc polygon two dimension boolean operation method, including:The data of main body A and main body B are read in successively, reject main body A and the unnecessary collinear points of main body B;Calculate island, the hole of main body A and main body B, and each island, the corresponding intersection point in hole and sub- side data, and calculate the minimum sub- side on island;The Hash mapping relation of island and hole intersection point corresponding with itself is created, is that each intersection point sets up its mapping relations with sub- side;Calculated by iterative algorithm each island and hole sub- side around numerical value;By union, difference set, the common factor Boolean calculation that main body A and main body B are carried out around numerical value.The segmental arc polygon two dimension boolean operation method that the present invention is provided can effectively solve class of a curve X-Y scheme Boolean calculation, and low cost, computing are fast.

Description

A kind of segmental arc polygon two dimension boolean operation method
Technical field
The present invention relates to graph processing technique field, more particularly to a kind of segmental arc polygon two dimension boolean operation method.
Background technology
Two-dimentional Boolean calculation is one of important content of computational geometry and computer graphics, its major function and result It is that simple figure can obtain complex figure after Boolean calculation, in Course Exercise in Machinery Elements Design, Construction plan design, shipbuilding All it is widely used etc. many fields.Used as the most frequently used, the most basic algorithmic tool of one kind, two-dimentional Boolean calculation is in PCB electricity Road plate manufacturing also extensive application.
Existing two-dimentional Boolean calculation algorithm typically describes graphic limit with the form of " ring ", for example, be widely used at present Two-dimentional Boolean calculation increase income storehouse Clipper, be a storehouse for very exquisite two-dimentional Boolean calculation, but it is similar with other Two-dimentional Boolean calculation storehouse has the shortcomings that common, can not exactly process curve, it is necessary to by curvilinear cut into approximate multistage straight line Could be processed after section.Data volume is so both increased, data type, complex disposal process are changed again.Prior art is also adopted Realize two-dimentional Boolean calculation demand with three-dimensional Boolean calculation storehouse, but three-dimensional storage capacity is big, high cost, expensive.
The content of the invention
For problem above, patent purpose of the present invention is to devise a kind of segmental arc polygon two dimension boolean operation method, Class of a curve X-Y scheme Boolean calculation can be effectively solved, low cost, computing are fast.
Specific technical scheme of the invention is as follows:
A kind of segmental arc polygon two dimension boolean operation method, including:
Step S101, reads in the data of main body A and main body B successively, rejects main body A and the unnecessary collinear points of main body B;
Step S102, calculates island, the hole of main body A and main body B, and each island, the corresponding intersection point in hole and sub- side data, And calculate the minimum sub- side on island;
Step S103, creates the Hash mapping relation of island and hole intersection point corresponding with itself, be each intersection point set up its with The mapping relations on sub- side;
Step S104, calculated by iterative algorithm each island and hole sub- side around numerical value;
Step S105, by union, difference set, the common factor Boolean calculation that main body A and main body B are carried out around numerical value.
Specifically, polygon is counterclockwise moved towards in island of the present invention for closing;The hole is suitable in the island Clockwise polygon;The intersection point is the connecting points or joining of the both sides of the polygon two section;The sub- side is two institutes State the side section between intersection point.
Specifically, the Hash mapping relation of establishment island of the present invention and hole intersection point corresponding with itself, is each intersection point Its mapping relations with sub- side is set up, is specifically included:
The mapping relations of each intersection point and sub- side are set up using iterative method.
Specifically, the sub- side that each island and hole are calculated by iterative algorithm of the present invention around numerical value, specifically include:
Definition is sub- side by the circular number of times of polygon around numerical value;
The winding number initial value on sub- side is 0, if sub- side is surround by certain polygon, if the polygon is counterclockwise, then Sub- side adds 1 around numerical value;If the polygon is clockwise, then sub- side subtracts 1 around numerical value.
The segmental arc polygon two dimension boolean operation method that the present invention is provided compared with prior art, can solve curve class two-dimensional Figure Boolean calculation, and smart small low cost, computing are powerful efficiently.
Brief description of the drawings
Embodiments of the present invention is further illustrated referring to the drawings, wherein:
Fig. 1 is topology definition figure of the invention;
Fig. 2 is Boolean calculation figure of the invention;
Fig. 3 is flow chart of the invention;
Fig. 4 is that data of the invention calculate process chart;
Fig. 5 is of the invention to set up mapping relations flow chart;
Fig. 6 is sub- side of the invention around numerical value calculation flow chart;
Fig. 7 is result of calculation flow chart of the invention.
Specific embodiment
The present invention is described in further detail with specific embodiment below in conjunction with the accompanying drawings.
The present invention proposes a kind of segmental arc polygon two dimension boolean operation method, can solve class of a curve X-Y scheme boolean fortune Calculate.
Fig. 1 is referred to, related topology definition is as follows:
Island Island:Closing counterclockwise moves towards polygon;
Hole Hole:Suitable clockwise direction polygon in island;
Intersection I nteraction:The connecting points of the both sides of polygon two section and the joining of two both sides section are referred to as intersection point;
Sub- side Edge:Side section between two intersection points.
Each 2d solid must have only one island, can be comprising multiple holes in island.
Fig. 2 is referred to, this hair is capable of achieving three kinds of Boolean calculation operations, and union operation (A ∪ B), difference operation (A-B) is handed over Collection operation (A ∩ B).
Fig. 3 is referred to, following steps are specifically included:
Step S101, reads in the data of main body A and main body B successively, rejects main body A and the unnecessary collinear points of main body B.
Step S102, calculates island, the hole of main body A and main body B, and each island, the corresponding intersection point in hole and sub- side data, And calculate the minimum sub- side on island.
Specifically, refer to Fig. 4, according to above-mentioned island, hole, and each island, the corresponding intersection point in hole and sub- side definition side Method, counts each data of main body A and main body B.To reject main body A and the unnecessary collinear points of main body B simultaneously.
Step S103, creates the Hash mapping relation of island and hole intersection point corresponding with itself, be each intersection point set up its with The mapping relations on sub- side.
Specifically, setting up the mapping relations of each intersection point and sub- side using iterative method, specific processing mode refers to Fig. 5.
Step S104, calculated by iterative algorithm each island and hole sub- side around numerical value.
Specifically, being each sub- side by the how many circular number of times of polygon around numerical value.The winding number initial value on sub- side is 0, around Number is a vector, if sub- side Edge is surround by a polygon Poly, if Poly is counterclockwise, then the winding number of Edge+ 1;If Poly is clockwise, then the winding number -1 of Edge.Because the sub- side on each island is by self loop around independent island The winding number on sub- side is equal to 1.And if including hole in independent island, then the Zi Bianjibei islands in its hole are around again by hole ring Around so the word side winding number in hole is 0.Specifically Fig. 6 is referred to around numerical value calculation process.
Step S105, by union, difference set, the common factor Boolean calculation that main body A and main body B are carried out around numerical value.
Specifically, the present invention realizes three kinds of Boolean calculation operations, union operation (A ∪ B), difference operation (A-B) occurs simultaneously Operation (A ∩ B).
Fig. 7 is referred to, by union, difference set, the common factor Boolean calculation strategy that main body A and main body B are carried out around numerical value Can be that each sub- side is easy to sum up what is come around numerical value, itself be the table that Boolean calculation geometrical rule is converted into winding number algebraically Existing form.
The pathfinding on pickup result side:Each island of iteration, hole, from the island, the minimum side in hole starts pathfinding, only walks to meet boolean's fortune The sub- side of pickup conditions is calculated, passing by and setting prevents from repeating to travel through by mark, when next road of discovery is passed by, means Pickup result and generate a closed loop, then find eligible sub- side of not passing by obtain, all of sub- side of loop iteration all iteration Cross and just terminate.
All new holes (polygon clockwise) for drawing need to find its ownership island again.Specification is done to new island hole Change.
The specific embodiment of present invention described above, is not intended to limit the scope of the present invention..Any basis Various other corresponding change and deformation that technology design of the invention is made, should be included in the guarantor of the claims in the present invention In the range of shield.

Claims (4)

1. a kind of segmental arc polygon two dimension boolean operation method, it is characterised in that including:
Step S101, reads in the data of main body A and main body B successively, rejects main body A and the unnecessary collinear points of main body B;
Step S102, calculates island, the hole of main body A and main body B, and each island, the corresponding intersection point in hole and sub- side data, and count Calculate the minimum sub- side on island;
Step S103, creates the Hash mapping relation of island and hole intersection point corresponding with itself, is that each intersection point sets up it with sub- side Mapping relations;
Step S104, calculated by iterative algorithm each island and hole sub- side around numerical value;
Step S105, by union, difference set, the common factor Boolean calculation that main body A and main body B are carried out around numerical value.
2. a kind of segmental arc polygon two dimension boolean operation method according to claim 1, it is characterised in that the island is envelope Close and counterclockwise move towards polygon;The hole is the suitable clockwise direction polygon in the island;The intersection point is described many The connecting points or joining of side Xing Liang both sides section;It is described it is sub- while be between two intersection points while section.
3. a kind of segmental arc polygon two dimension boolean operation method according to claim 2, it is characterised in that the establishment island The Hash mapping relation of intersection point corresponding with itself with hole, is that each intersection point sets up its mapping relations with sub- side, is specifically included:
The mapping relations of each intersection point and sub- side are set up using iterative method.
4. a kind of segmental arc polygon two dimension boolean operation method according to claim 1, it is characterised in that described by repeatedly Calculated for algorithm each island and hole sub- side around numerical value, specifically include:
Definition is sub- side by the circular number of times of polygon around numerical value;
The winding number initial value on sub- side is 0, if sub- side is surround by certain polygon, if the polygon is counterclockwise, then sub- side Add 1 around numerical value;If the polygon is clockwise, then sub- side subtracts 1 around numerical value.
CN201710035970.9A 2017-01-18 2017-01-18 A kind of segmental arc polygon two dimension boolean operation method Pending CN106898028A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710035970.9A CN106898028A (en) 2017-01-18 2017-01-18 A kind of segmental arc polygon two dimension boolean operation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710035970.9A CN106898028A (en) 2017-01-18 2017-01-18 A kind of segmental arc polygon two dimension boolean operation method

Publications (1)

Publication Number Publication Date
CN106898028A true CN106898028A (en) 2017-06-27

Family

ID=59198887

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710035970.9A Pending CN106898028A (en) 2017-01-18 2017-01-18 A kind of segmental arc polygon two dimension boolean operation method

Country Status (1)

Country Link
CN (1) CN106898028A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018132989A1 (en) * 2017-01-19 2018-07-26 深圳市百能信息技术有限公司 Segmental arc polygon two-dimensional boolean operating method
CN109241621A (en) * 2018-09-05 2019-01-18 广东三维家信息科技有限公司 A kind of water knife parquets technology discussed based on computer graphic with curvilinear figure Boolean calculation
CN115018697A (en) * 2022-08-08 2022-09-06 中科星图测控技术(合肥)有限公司 Earth surface polygon Boolean operation algorithm and computer system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018132989A1 (en) * 2017-01-19 2018-07-26 深圳市百能信息技术有限公司 Segmental arc polygon two-dimensional boolean operating method
CN109241621A (en) * 2018-09-05 2019-01-18 广东三维家信息科技有限公司 A kind of water knife parquets technology discussed based on computer graphic with curvilinear figure Boolean calculation
CN109241621B (en) * 2018-09-05 2023-06-16 广东三维家信息科技有限公司 Water jet pattern splicing method based on computer graph theory and curve graph Boolean operation
CN115018697A (en) * 2022-08-08 2022-09-06 中科星图测控技术(合肥)有限公司 Earth surface polygon Boolean operation algorithm and computer system
CN115018697B (en) * 2022-08-08 2022-11-22 中科星图测控技术(合肥)有限公司 Earth surface polygon Boolean operation algorithm and computer system

Similar Documents

Publication Publication Date Title
Dao et al. A bibliometric analysis of Genetic Algorithms throughout the history
CN106898028A (en) A kind of segmental arc polygon two dimension boolean operation method
CN106774151B (en) A kind of Cutter Radius Compensation Method that can avoid cutting
Vahedi et al. Caging polygons with two and three fingers
WO2015181912A1 (en) Tool path generation device and method
Cons et al. Integrating task and motion planning for unmanned aerial vehicles
CN104809760B (en) The three-dimensional outline method for auto constructing of geographical space based on depth-first strategy
CN105447284A (en) Technical allowance adding method
US20200041213A1 (en) Flat-plate heat pipe structure
CN103699722B (en) A kind of design method of sheet metal component technical lug
CN100419734C (en) Computing-oriented general reconfigureable computing array
CN108776691A (en) A kind of optimization method and system of space diagram aggregation
CN102360387A (en) Method for outputting geometric data of facet element of vector data transfer format of topology 1
CN103902772A (en) Staggered pin structure based escape wiring method for isometric difference pairs
CN104408285A (en) Intelligent computing method for dimensional chain
CN104462239A (en) Customer relation discovery method based on data vectorization spatial analysis
CN103529755B (en) A kind of High-precision linear interpolation method
WO2018132989A1 (en) Segmental arc polygon two-dimensional boolean operating method
CN106960106B (en) Super-periodic structure and design method thereof
KR20080008467A (en) Method for designing straight bevel gear with localized bearing contact
CN205446174U (en) A location structure for compressor blade forging
CN110610029A (en) Method for designing three-dimensional special-shaped plate based on planar parametric dotted line polygon
Abam et al. Kinetic pie delaunay graph and its applications
Chen et al. A DGR method for extracting the topology of an upper-half profile of a turned part from CAD data
CN110276095B (en) Workpiece model contour line shape self-adaptive decomposition method and device

Legal Events

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

Application publication date: 20170627