CN103544720A - Method for rapidly drawing doors and windows on plane room graph - Google Patents
Method for rapidly drawing doors and windows on plane room graph Download PDFInfo
- Publication number
- CN103544720A CN103544720A CN201310517486.1A CN201310517486A CN103544720A CN 103544720 A CN103544720 A CN 103544720A CN 201310517486 A CN201310517486 A CN 201310517486A CN 103544720 A CN103544720 A CN 103544720A
- Authority
- CN
- China
- Prior art keywords
- point
- line segment
- rectangle
- line
- curve
- 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.)
- Granted
Links
Images
Landscapes
- Processing Or Creating Images (AREA)
Abstract
The invention discloses a method for rapidly drawing doors and windows on a plane room graph. The method comprises the following steps of (1) determination of the positions of the doors and the windows, (2) judgment, (3) calculation and (4) drawing, wherein in the step (1), the positions of the doors to be drawn and the windows to be drawn are determined at the straight line side or the curved line side of the plane room graph, line segments are drawn on the portions where the doors and the windows are arranged, the line segments and the straight line side or the curved line side intersect and serve as the positions of the doors and the windows at the straight line side or the curved line side; in the step (2), the conditions of intersection of the drawn line segments and the straight line side or the curved line side are judged one by one; in the step (3), the line segments serve as diagonals, coordinates of four points of a rectangle to be drawn are calculated, one side of the rectangle is parallel to the straight line side or parallel to a tangent line on the intersecting portion of each line segment and the curved line side; in the step (4), according to the calculated coordinates of the four points of the rectangle, the current line segments serve as the diagonals, the four points are connected, so that the rectangle is established, and the simple doors and the simple windows are drawn. According to the method for rapidly drawing the doors and the windows on the plane room graph, the doors and the windows can be rapidly drawn on the plane room graph.
Description
Technical field
The present invention relates to computer software picture technical field, especially a kind of on plane room figure the method for Fast Drawing door and window.
Background technology
People mapped on paper with pen in the past, and the length that expends time in, once and the wrong perfect correction that is difficult to of picture.Computing machine has become an indispensable part in human being's production life now, and a lot of people utilize various software to draw on computers the various required figures such as engineering drawing, architectural drawing, plane design drawing, machine drawing, circuit diagram, process flow diagram, schematic diagram.Utilize software to replace the mapping of paper pen not only to save time, raise the efficiency, and can repeatedly change, long preservation, increasing people starts study and utilizes software to draw, and more people has started to be accustomed to and has enjoyed modern science and technology to bring their comfortable convenient.
Present drawing software is varied, relatively common are Photoshop, freehand, AutoCAD, Matlab etc., and every kind of software has own different feature, most of software has toolbar clearly to provide instrument to help to draw, can draw different lines, shape, color.
For draw door and window on easy plane room figure, existing two schemes is available:
The first is to utilize straight line tool to draw four edges to surround door and window general shape or draw rectangle and replace door and window shape, and can Selective filling color, completes the drafting of simple and easy door and window figure.
The second is in toolbar, to have simple and easy door and window figure, utilizes mouse drag to be placed in correct position in drawing interface, then adjusts size by other functions, and the indexs such as color, to reach the effect of drawing simple and easy door and window.
In the technology of Internet of things more and more rising now, often need to draw in computer terminal plane room figure and come room layout that is virtually reality like reality, do not need too attractive in appearancely, only demand simple and clearly, give top priority to what is the most important.And door and window is the indispensable part of plane room figure, if utilize above-mentioned two schemes, can draw good door and window figure, but fixedly the step of flow process, while especially drawing a plurality of door and window, needs repeatedly fixing step, relatively the labor intensive material resources time, efficiency is not very high.
Summary of the invention
The present invention is directed to the deficiencies in the prior art, propose a kind of on plane room figure the method for Fast Drawing door and window, simple and fast, effective.
In order to realize foregoing invention object, the invention provides following technical scheme: a kind of on plane room figure the method for Fast Drawing door and window, comprise the following steps:
(1) determine door and window position: in the straight sides of plane room figure or curvilinear sides, determine the position that will draw door and window, all, arrange that door and window position draws a line segment and straight sides or curvilinear sides intersects, with this line segment, represent the position of door and window in straight sides or curvilinear sides;
(2) determining step: judge that one by one drawn line segment and straight sides or curvilinear sides intersect situation;
(3) calculation procedure: take line segment as diagonal line, calculate four point coordinate that will draw rectangle, wherein one side of this rectangle is parallel with straight sides, or parallel with the tangent line of curvilinear sides intersection with this line segment;
(4) plot step: according to four apex coordinates of the rectangle calculating, take current line segment as diagonal line, connect four some structure rectangles, complete the drafting of simple and easy door and window.
Further, in determining step, judge the step that this line segment and straight line are crossing:
Step (211): this line segment two-end-point is made as A, B, institute's intersecting straight lines side two-end-point is made as C, D, obtains ABCD tetra-point coordinate, A (
,
), B (
,
), C (
,
), D (
,
), at AC point-to-point transmission structure vector
, AD point-to-point transmission structure vector
, AB point-to-point transmission structure vector
, by A point, set out, point to BCD point; Obtain CD line segment slope k, AB line segment slope
, establish
,
if,
or k
=-1, return to step and determine door and window position, setting-out section again; If variable
;
Further, in determining step, judge the step of this line segment and curve intersection:
Step (221): calculate each parameter of curve, the home position that the curve of take is circular arc, and radius is r.
Step (222): establishing this line segment two-end-point is A, B, institute's intersection curve side two-end-point is made as C, D, obtains ABCD tetra-point coordinate, A (
,
), B (
,
), C (
,
), D (
,
); If the tangent slope at line segment AB and intersections of complex curve place is
if, k
=-1,
or
, return to step and determine door and window position, setting-out section again; The center of circle to A point line segment is
, the center of circle to B point line segment is
, connecting the center of circle is two radiuses to C, D two-end-point, and central angle is theta, and C, 2 of D intersect at an E as tangent line excessively, and the center of circle is made as to E point line segment
, draw respectively
,
length, and
,
,
slope
,
, k, and
with
,
with
angle
,
;
Further, in calculation procedure, while intersecting with straight line, calculate rectangle four apex coordinate steps:
Take line segment AB as diagonal line, utilize ABCD tetra-point coordinate calculate other two apex coordinates of drawn rectangle (
,
) and (
,
);
Further, in calculation procedure, when some, calculate rectangle four apex coordinate steps with curve intersection:
Obtain
with
mean value
, obtain respectively
,
upper apart from distance of center circle from being
point, be designated as respectively M(
,
) and N(
,
).Obtain with (
,
) and (
,
) be the straight slope k of end points, take AB as diagonal line, utilize these ABMN tetra-point coordinate calculate other two apex coordinates of drawn rectangle (
,
) and (
,
);
;
;
Further, in calculation procedure, calculate rectangle four apex coordinate steps in 2 time with curve intersection:
Cross the center of circle and make the perpendicular bisector of line segment AB, hand over curve in a P(
,
), cross the tangent line that P point is made circle, point of contact is for drawing the mid point on other two summits of rectangle, and the slope of AB line segment place straight line is
, establishing other 2 of rectangle is M(
,
) and N(
,
), calculate two point coordinate formula and be:
Compared with prior art, the present invention has the following advantages: with respect to existing picture technology, can determine door and window position and draw the rectangle that represents door and window by only drawing a line segment, a lot of unnecessary repeating steps have been saved, save time, raise the efficiency, be very easily a kind of on plane room figure the scheme of Fast Drawing door and window, and can realize on straight line and curve and all along straight line or direction of curve, automatically generate door and window figure, experimental results show that, this scheme can be to realize, and has obtained good effect.
Accompanying drawing explanation
The one-piece construction block diagram of Fig. 1 simple and easy door and window of Fast Drawing on plane room figure;
Fig. 2 judges first step mathematics geometric figure when whether line segment intersects with straight line;
Fig. 3 judges second step mathematics geometric figure when whether line segment intersects with straight line;
Fig. 4 for judge line segment whether with the crossing flow chart of steps of straight line;
Fig. 5 is mathematics geometric figure when judging line segment whether with curve intersection;
Fig. 6 is the flow chart of steps judging whether with curve intersection;
Fig. 7 is that line segment and straight line calculate rectangle four point coordinate step course diagrams while intersecting;
Fig. 8 calculates rectangle four point coordinate flow chart of steps while being line segment and curve intersection;
Fig. 9 is that line segment and curve intersection calculate the flow chart of steps of four point coordinate in the time of 2;
Figure 10 to Figure 14 is the process demonstration graph of the simple and easy door and window of Fast Drawing on plane room figure.
Embodiment
Below in conjunction with accompanying drawing, describe the present invention, the description of this part is only exemplary and explanatory, should not have any restriction to protection scope of the present invention.
Fig. 1 is the process flow diagram of an embodiment of the invention, comprises the following steps:
Step (1): determine the position that will draw door and window on the straight line of plane room figure or curve, go out a line segment and straight line or curve intersection in door and window position by mouse drag, represent the position of door and window on straight line or curve with this line segment.
Step (21): judge whether this line segment intersects with straight line.
Step (22): judge this line segment whether with curve intersection.
Step (3): calculate four point coordinate that will draw rectangle.
Step (4): according to four apex coordinates of the rectangle calculating, take current line segment as diagonal line, connect four some structure rectangles with the lineTo () function in canvas, complete the drafting of simple and easy door and window.
Fig. 4 describes the detailed process of step in Fig. 1 (21) in detail:
Step (211): current line segment two-end-point is made as A, B, institute's intersecting straight lines two-end-point is made as C, D, obtains ABCD tetra-point coordinate, A (
,
), B (
,
), C (
,
), D (
,
), obtain CD line segment slope k, AB line segment slope
, establish
,
if,
, illustrating that drawn line segment length exceeds former line segment length, abnormal conditions prompting repaints.If k
=-1, illustrate that drawn line segment is vertical with former line segment, abnormal conditions prompting repaints.Otherwise, at AC point-to-point transmission structure vector
, AD point-to-point transmission structure vector
, AB point-to-point transmission structure vector
, by A point, set out, point to BCD point.Obtain CD line segment slope k, establish variable
, as shown in Figure 2.
Step (212): redefine vector
,
,
,
vector is CA,
vector is CB,
vector is CD, establishes variable
, as shown in Figure 3.If
value be all less than or equal to 0, intersect execution step (31) with straight line.Otherwise, execution step (22).
Fig. 6 describes the detailed process of step in Fig. 1 (22) in detail:
Step (221): obtain each parameter of curve, the home position that the curve of take is circular arc, and radius is r.
Step (222): establishing current line segment two-end-point is A, B, AB line segment slope
if
or
have a condition to set up, abnormal conditions prompting repaints.If line segment AB and intersections of complex curve are E, the curve tangent slope that E is ordered is excessively
if, k
=-1, illustrate that this tangent line of drawn line segment and curve is vertical, abnormal conditions prompting repaints.Otherwise, establish the center of circle and to A point line segment be
, the center of circle to B point line segment is
, connecting the center of circle is two radiuses to C, D two-end-point, and central angle is theta, and C, 2 of D intersect at an E as tangent line excessively, and the center of circle is made as to E point line segment
, as shown in Figure 5, obtain respectively
,
length, and
,
,
slope
,
, k, and
with
,
with
angle
,
.
Step (223): if
>r,
<r, and
,
all be less than theta/2, with curve intersection, execution step (32).
Fig. 7 describes the detailed process of step (31) in detail:
Take line segment AB as diagonal line, utilize ABCD tetra-point coordinate calculate other two apex coordinates of drawn rectangle (
,
) and (
,
).
Fig. 8 describes the detailed process of step (32) in detail:
Obtain
with
mean value
, obtain respectively
,
upper apart from distance of center circle from being
point, be designated as respectively M(
,
) and N(
,
).Obtain with (
,
) and (
,
) be the straight slope k of end points, take AB as diagonal line, utilize these ABMN tetra-point coordinate calculate other two apex coordinates of drawn rectangle (
,
) and (
,
).
Fig. 9 describes the detailed process of step (33) in detail:
Cross the center of circle and make the perpendicular bisector of line segment AB, hand over curve in a P(
,
), cross the tangent line that P point is made circle, point of contact is for drawing the mid point on other two summits of rectangle, and the slope of AB line segment place straight line is
, establishing other 2 of rectangle is M(
,
) and N(
,
), calculate two point coordinate formula and be:
Figure 10 to Figure 14 is the process demonstration graph of the simple and easy door and window of Fast Drawing on plane room figure, and it specifically represents that implication is:
Figure 10 is simple and easy two dimensional surface room figure.
Figure 11 is that setting-out section is determined door and window position on plane room figure cathetus.
Figure 12 is design sketch after Fast Drawing door and window on straight line.
Figure 13 in plane room figure on curve setting-out section determine door and window position.
Figure 14 is design sketch after Fast Drawing door and window on curve.
By the description of above embodiment, one of ordinary skill in the art can clearly understand implementation procedure of the present invention, and can experimental results show that repeatability of the present invention according to above-mentioned steps, the present invention be a kind of on straight line or curve the scheme of Fast Drawing door and window, propose and existing method for drafting different solution all.
Above-described embodiment of the present invention, does not form the restriction to invention protection domain.Any modification of doing within the spirit and principles in the present invention, be equal to and replace and improvement etc., within all should being included in protection scope of the present invention.
Claims (6)
1. a method for Fast Drawing door and window on plane room figure, comprises the following steps:
(1) determine door and window position: in the straight sides of plane room figure or curvilinear sides, determine the position that will draw door and window, all, arrange that door and window position draws a line segment and straight sides or curvilinear sides intersects, with this line segment, represent the position of door and window in straight sides or curvilinear sides;
(2) determining step: judge that one by one drawn line segment and straight sides or curvilinear sides intersect situation;
(3) calculation procedure: take line segment as diagonal line, calculate four point coordinate that will draw rectangle, wherein one side of this rectangle is parallel with straight sides, or parallel with the tangent line of curvilinear sides intersection with this line segment;
(4) plot step: according to four apex coordinates of the rectangle calculating, take current line segment as diagonal line, connect four some structure rectangles, complete the drafting of simple and easy door and window.
2. the method for claim 1, is characterized in that: in determining step, judge the step that this line segment and straight line are crossing:
Step (211): this line segment two-end-point is made as A, B, institute's intersecting straight lines side two-end-point is made as C, D, obtains ABCD tetra-point coordinate, A (
,
), B (
,
), C (
,
), D (
,
), at AC point-to-point transmission structure vector
, AD point-to-point transmission structure vector
, AB point-to-point transmission structure vector
, by A point, set out, point to BCD point; Obtain CD line segment slope k, AB line segment slope
, establish
,
if,
or k
=-1, return to step and determine door and window position, setting-out section again; If variable
;
3. the method for claim 1, is characterized in that: in determining step, judge the step of this line segment and curve intersection:
Step (221): calculate each parameter of curve, the home position that the curve of take is circular arc, and radius is r;
Step (222): establishing this line segment two-end-point is A, B, institute's intersection curve side two-end-point is made as C, D, obtains ABCD tetra-point coordinate, A (
,
), B (
,
), C (
,
), D (
,
); If the tangent slope at line segment AB and intersections of complex curve place is
if, k
=-1,
or
, return to step and determine door and window position, setting-out section again; The center of circle to A point line segment is
, the center of circle to B point line segment is
, connecting the center of circle is two radiuses to C, D two-end-point, and central angle is theta, and C, 2 of D intersect at an E as tangent line excessively, and the center of circle is made as to E point line segment
, draw respectively
,
length, and
,
,
slope
,
, k, and
with
,
with
angle
,
;
4. method as claimed in claim 2, is characterized in that: in calculation procedure, calculate rectangle four apex coordinate steps while intersecting with straight line:
Take line segment AB as diagonal line, utilize ABCD tetra-point coordinate calculate other two apex coordinates of drawn rectangle (
,
) and (
,
);
5. method as claimed in claim 3, is characterized in that: in calculation procedure, calculate rectangle four apex coordinate steps with curve intersection when a bit:
Obtain
with
mean value
, obtain respectively
,
upper apart from distance of center circle from being
point, be designated as respectively M(
,
) and N(
,
); Obtain with (
,
) and (
,
) be the straight slope k of end points, take AB as diagonal line, utilize these ABMN tetra-point coordinate calculate other two apex coordinates of drawn rectangle (
,
) and (
,
);
6. method as claimed in claim 3, is characterized in that: in calculation procedure, calculate rectangle four apex coordinate steps with curve intersection in 2 time:
Cross the center of circle and make the perpendicular bisector of line segment AB, hand over curve in a P(
,
), cross the tangent line that P point is made circle, point of contact is for drawing the mid point on other two summits of rectangle, and the slope of AB line segment place straight line is
, establishing other 2 of rectangle is M(
,
) and N(
,
), calculate two point coordinate formula and be:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310517486.1A CN103544720B (en) | 2013-10-29 | 2013-10-29 | Plane room graph is drawn the method for door and window fast |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310517486.1A CN103544720B (en) | 2013-10-29 | 2013-10-29 | Plane room graph is drawn the method for door and window fast |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103544720A true CN103544720A (en) | 2014-01-29 |
CN103544720B CN103544720B (en) | 2016-06-01 |
Family
ID=49968138
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310517486.1A Expired - Fee Related CN103544720B (en) | 2013-10-29 | 2013-10-29 | Plane room graph is drawn the method for door and window fast |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103544720B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109271704A (en) * | 2018-09-12 | 2019-01-25 | 深圳市彬讯科技有限公司 | CAD house type forms recognition methods and CAD house type forms identification device |
CN111639150A (en) * | 2020-06-02 | 2020-09-08 | 中国人民解放军陆军装甲兵学院 | Method and system for displaying details of electronic map enlarged area |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20060080350A (en) * | 2005-01-05 | 2006-07-10 | 엘지전자 주식회사 | Method of drawing shape based on mobile device |
CN101408988A (en) * | 2008-11-07 | 2009-04-15 | 武汉虹信通信技术有限责任公司 | Method for drafting expandable line |
CN101719057A (en) * | 2009-11-27 | 2010-06-02 | 广东威创视讯科技股份有限公司 | Method and device for drawing geometric figures |
-
2013
- 2013-10-29 CN CN201310517486.1A patent/CN103544720B/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20060080350A (en) * | 2005-01-05 | 2006-07-10 | 엘지전자 주식회사 | Method of drawing shape based on mobile device |
CN101408988A (en) * | 2008-11-07 | 2009-04-15 | 武汉虹信通信技术有限责任公司 | Method for drafting expandable line |
CN101719057A (en) * | 2009-11-27 | 2010-06-02 | 广东威创视讯科技股份有限公司 | Method and device for drawing geometric figures |
Non-Patent Citations (1)
Title |
---|
石林祥: "建筑门窗CAD系统关键技术的研究", 《山西煤炭管理干部学院学报》, 31 December 2011 (2011-12-31), pages 35 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109271704A (en) * | 2018-09-12 | 2019-01-25 | 深圳市彬讯科技有限公司 | CAD house type forms recognition methods and CAD house type forms identification device |
CN109271704B (en) * | 2018-09-12 | 2022-12-30 | 深圳市彬讯科技有限公司 | CAD house type window body identification method and CAD house type window body identification device |
CN111639150A (en) * | 2020-06-02 | 2020-09-08 | 中国人民解放军陆军装甲兵学院 | Method and system for displaying details of electronic map enlarged area |
CN111639150B (en) * | 2020-06-02 | 2023-09-19 | 中国人民解放军陆军装甲兵学院 | Electronic map enlarged region detail display method and system |
Also Published As
Publication number | Publication date |
---|---|
CN103544720B (en) | 2016-06-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103544728B (en) | A kind of based on normal vector in live-action map by spy face filter method | |
CN104898947B (en) | A kind of method that GDI electronics map vector scaling and translation are realized based on mouse position | |
CN107544506B (en) | Robot following method, robot, and storage medium | |
CN107085865B (en) | Quadrilateral segmentation method applied to finite element analysis | |
CN101877736A (en) | Automatic adjusting system and method for user interface of mobile terminal | |
CN106845037B (en) | A kind of general method for solving of inverse kinematics of five degree of freedom serial manipulator | |
CN103236077B (en) | The three-dimensional model line method for drafting that a kind of feature strengthens | |
CN112365572B (en) | Rendering method based on surface subdivision and related products thereof | |
CN104574505A (en) | Automatic three-dimensional pipeline communication modeling method | |
CN103544720A (en) | Method for rapidly drawing doors and windows on plane room graph | |
CN103885571A (en) | Information processing method and electronic equipment | |
WO2018103227A1 (en) | Method and device for drawing symmetrical figure | |
CN102663805A (en) | Projection-based view frustum cutting method | |
CN103489221B (en) | Quadrilateral mesh conformal Parameterization method | |
CN103310409B (en) | A kind of Tile-based renders the fast triangle block method of framework GPU | |
WO2023217032A1 (en) | Robot collision detection method, storage medium and electronic device | |
CN106896966A (en) | Contact position and the method and apparatus of shape information storage in infrared touch panel | |
CN106095158A (en) | The system that the computational methods of light target displacement vector, device and control cursor move | |
CN106874919A (en) | A kind of method and apparatus for determining ship hull plate angle point | |
CN113836674A (en) | Pipeline segment three-dimensional space interference detection and shortest distance point acquisition algorithm | |
CN104731492B (en) | A kind of magic pen and its display control method | |
CN106965183A (en) | A kind of robot control system and its method of work that mechanism is perceived based on the depth of field | |
Yang et al. | On the normal vector estimation for point cloud data from smooth surfaces. | |
JP2022095121A5 (en) | ||
CN107633543A (en) | Consider the stripe shape corresponding method of local topology |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20160601 Termination date: 20171029 |