Points, lines, and planes

本文提供了一系列关于点、线和平面之间距离及交点的计算方法,包括点到直线的距离、点到平面的距离、两线段交点等,并给出了相应的数学推导。

Points, lines, and planes

In what follows are various notes and algorithms dealing with points, lines, and planes.




Minimum Distance between 
a Point and a Line

Written by  Paul Bourke
October 1988

This note describes the technique and gives the solution to finding the shortest distance from a point to a line or line segment. The equation of a line defined through two points P1 (x1,y1) and P2 (x2,y2) is

P =  P1 + u ( P2 -  P1)

The point P3 (x3,y3) is closest to the line at the tangent to the line which passes through P3, that is, the dot product of the tangent and line is 0, thus

( P3 -  P) dot ( P2 -  P1) = 0

Substituting the equation of the line gives

[ P3 P1 - u( P2 -  P1)] dot ( P2 -  P1) = 0

Solving this gives the value of u

Substituting this into the equation of the line gives the point of intersection (x,y) of the tangent as

x = x1 + u (x2 - x1)
y = y1 + u (y2 - y1)

The distance therefore between the point P3 and the line is the distance between (x,y) above and P3.

Notes

  • The only special testing for a software implementation is to ensure that P1 and P2 are not coincident (denominator in the equation for u is 0)

  • If the distance of the point to a line segment is required then it is only necessary to test that u lies between 0 and 1.

  • The solution is similar in higher dimensions.

Contributed implementations
C source from Damian Coventry: C source code
VBA from Brandon Crosby: VBA source code
Dephi from Graham O'Brien: Delphi version
"R" version from Gregoire Thomas: pointline.r
JAVA version from Pieter Iserbyt: DistancePoint.java
LabView implementation from Chris Dancer: Pointlinesegment.vi.zip
Right side distance by Orion Elenzil: rightside
VBA VB6 by Thomas Ludewig: vbavb6.txt




Minimum Distance between 
a Point and a Plane

Written by  Paul Bourke
March 1996

Let Pa = (xa, ya, za) be the point in question.

A plane can be defined by its normal n = (A, B, C) and any point on the plane Pb = (xb, yb, zb)

Any point P = (x,y,z) lies on the plane if it satisfies the following

A x + B y + C z + D = 0

The minimum distance between Pa and the plane is given by the absolute value of

(A x a + B y a + C z a + D) / sqrt(A 2 + B 2 + C 2)
. . . 1

To derive this result consider the projection of the line (Pa - Pb) onto the normal of the plane n, that is just ||Pa - Pb|| cos(theta), where theta is the angle between (Pa - Pb) and the normal n. This projection is the minimum distance of Pa to the plane.

This can be written in terms of the dot product as

minimum distance = ( Pa -  Pb) dot  n / || n||

That is

minimum distance = (A (x a - x b) + B (y a - y b) + C (z a - z b)) / sqrt(A 2 + B 2 + C 2)
. . . 2

Since point (xb, yb, zb) is a point on the plane

A x b + B y b + C z b + D = 0
. . . 3

Substituting equation 3 into equation 2 gives the result shown in equation 1.




Intersection point of two line segments in 2 dimensions

Written by  Paul Bourke
April 1989

This note describes the technique and algorithm for determining the intersection point of two lines (or line segments) in 2 dimensions.

The equations of the lines are

Pa =  P1 + u a (  P2 -  P1 )

Pb = P3 + ub ( P4 - P3 )

Solving for the point where Pa = Pb gives the following two equations in two unknowns (ua and ub)

x1 + u a (x2 - x1) = x3 + u b (x4 - x3)

and 
y1 + u a (y2 - y1) = y3 + u b (y4 - y3)

Solving gives the following expressions for ua and ub

Substituting either of these into the corresponding equation for the line gives the intersection point. For example the intersection point (x,y) is

x = x1 + u a (x2 - x1)

y = y1 + ua (y2 - y1)

Notes:

  • The denominators for the equations for ua and ub are the same.

  • If the denominator for the equations for ua and ub is 0 then the two lines are parallel.

  • If the denominator and numerator for the equations for ua and ub are 0 then the two lines are coincident.

  • The equations apply to lines, if the intersection of line segments is required then it is only necessary to test if ua and ub lie between 0 and 1. Whichever one lies within that range then the corresponding line segment contains the intersection point. If both lie within the range of 0 to 1 then the intersection point is within both line segments.
Source code

Original C code by Paul Bourke.
C++ contribution by Damian Coventry.
LISP implementation by Paul Reiners.
C version for Rockbox firmware by Karl Kurbjun.
C# version by Olaf Rabbachin.
VB.net version by Olaf Rabbachin.
VBA implementation by Giuseppe Iaria.




The shortest line between two lines in 3D

Written by  Paul Bourke
April 1998

Two lines in 3 dimensions generally don't intersect at a point, they may be parallel (no intersections) or they may be coincident (infinite intersections) but most often only their projection onto a plane intersect.. When they don't exactly intersect at a point they can be connected by a line segment, the shortest line segment is unique and is often considered to be their intersection in 3D.

The following will show how to compute this shortest line segment that joins two lines in 3D, it will as a bi-product identify parallel lines. In what follows a line will be defined by two points lying on it, a point on line "a" defined by points P1 and P2 has an equation.

P a = P 1 + mu a (P 2 - P 1)

similarly a point on a second line "b" defined by points P4and P4 will be written as

P b = P 3 + mu b (P 4 - P 3)

The values of mua and mub range from negative to positive infinity. The line segments between P1 P2 and P3 P4 have their corresponding mu between 0 and 1.

There are two approaches to finding the shortest line segment between lines "a" and "b". The first is to write down the length of the line segment joining the two lines and then find the minimum. That is, minimise the following

|| P b - P a || 2

Substituting the equations of the lines gives

|| P 1 - P 3 + mu a (P 2 - P 1) - mu b (P 4 - P 3) || 2

The above can then be expanded out in the (x,y,z) components. There are conditions to be met at the minimum, the derivative with respect to mua and mub must be zero. Note: it is easy to convince oneself that the above function only has one minima and no other minima or maxima. These two equations can then be solved for mua and mub, the actual intersection points found by substituting the values of mu into the original equations of the line.

An alternative approach but one that gives the exact same equations is to realise that the shortest line segment between the two lines will be perpendicular to the two lines. This allows us to write two equations for the dot product as

(P a - P b) dot (P 2 - P 1) = 0

(Pa - Pb) dot (P4 - P3) = 0

Expanding these given the equation of the lines

( P 1 - P 3 + mu a (P 2 - P 1) - mu b (P 4 - P 3) ) dot (P 2 - P 1) = 0

( P1 - P3 + mua (P2 - P1) - mub (P4 - P3) ) dot (P4 - P3) = 0

Expanding these in terms of the coordinates (x,y,z) is a nightmare but the result is as follows

d 1321 + mu a d 2121 - mu b d 4321 = 0

d1343 + mua d4321 - mub d4343 = 0

where

d mnop = (x m - x n)(x o - x p) + (y m - y n)(y o - y p) + (z m - z n)(z o - z p)

Note that dmnop = dopmn

Finally, solving for mua gives

mu a = ( d 1343 d 4321 - d 1321 d 4343 ) / ( d 2121 d 4343 - d 4321 d 4321 )

and back-substituting gives mub

mu b = ( d 1343 + mu a d 4321 ) / d 4343

Source Code

Original C source code from the author: lineline.c
Contribution by Dan Wills in MEL (Maya Embedded Language): source.mel.
A Matlab version by Cristian Dima: linelineintersect.m.
A Maxscript function by Chris Johnson: LineLineIntersect.ms
LISP version for AutoCAD (and Intellicad) by Andrew Bennett: int1.lsp and int2.lsp
A contribution by Bruce Vaughan in the form of a Python script for the SDS/2 design software: L3D.py
C# version by Ronald Holthuizen: calclineline.cs
VBA VB6 version by Thomas Ludewig: vbavb6.txt




Intersection of a plane and a line

Written by  Paul Bourke
August 1991

Contribution by Bryan Hanson: Implementation in R

This note will illustrate the algorithm for finding the intersection of a line and a plane using two possible formulations for a plane.

Solution 1

The equation of a plane (points  P  are on the plane with normal  N  and point  P3  on the plane) can be written as

N dot ( P -  P3) = 0

The equation of the line (points  P  on the line passing through points  P1  and  P2 ) can be written as

P =  P1 + u ( P2 -  P1)

The intersection of these two occurs when

N dot ( P1 + u ( P2 -  P1)) =  N dot  P3

Solving for u gives

Note

  • If the denominator is 0 then the normal to the plane is perpendicular to the line. Thus the line is either parallel to the plane and there are no solutions or the line is on the plane in which case there are an infinite number of solutions

  • If it is necessary to determine the intersection of the line segment between P1 and P2 then just check that u is between 0 and 1.

Solution 2

A plane can also be represented by the equation

A x + B y + C z + D = 0

where all points (x,y,z) lie on the plane.

Substituting in the equation of the line through points P1 (x1,y1,z1) and P2 (x2,y2,z2)

P = P1 + u (P2 - P1)

gives

A (x1 + u (x2 - x1)) + B (y1 + u (y2 - y1)) + C (z1 + u (z2 - z1)) + D = 0

Solving for u

Note

  • the denominator is 0 then the normal to the plane is perpendicular to the line. Thus the line is either parallel to the plane and there are no solutions or the line is on the plane in which case are infinite solutions

  • if it is necessary to determine the intersection of the line segment between P1 and P2 then just check that u is between 0 and 1.




Equation of a plane

Written by  Paul Bourke
March 1989
The standard equation of a plane in 3 space is

Ax + By + Cz + D = 0

The normal to the plane is the vector (A,B,C).

Given three points in space (x1,y1,z1), (x2,y2,z2), (x3,y3,z3) the equation of the plane through these points is given by the following determinants.

Expanding the above gives
A = y1 (z2 - z3) + y2 (z3 - z1) + y3 (z1 - z2) 
B = z1 (x2 - x3) + z2 (x3 - x1) + z3 (x1 - x2) 
C = x1 (y2 - y3) + x2 (y3 - y1) + x3 (y1 - y2) 
- D = x1 (y2 z3 - y3 z2) + x2 (y3 z1 - y1 z3) + x3 (y1 z2 - y2 z1)

Note that if the points are colinear then the normal (A,B,C) as calculated above will be (0,0,0).

The sign of s = Ax + By + Cz + D determines which side the point (x,y,z) lies with respect to the plane. If s > 0 then the point lies on the same side as the normal (A,B,C). If s < 0 then it lies on the opposite side, if s = 0 then the point (x,y,z) lies on the plane.

Alternatively

If vector N is the normal to the plane then all points p on the plane satisfy the following

N . p = k

where . is the dot product between the two vectors.

ie: a . b = (ax,ay,az) . (bx,by,bz) = ax bx + ay by + az bz

Given any point a on the plane

N . (p - a) = 0




The intersection of two planes

Written by  Paul Bourke
February 2000

The intersection of two planes (if they are not parallel) is a line.

Define the two planes with normals N as

N1 .  p = d 1

N2 . p = d2

The equation of the line can be written as

p = c 1  N1 + c 2  N2 + u  N1 *  N2

Where "*" is the cross product, "." is the dot product, and u is the parameter of the line.

Taking the dot product of the above with each normal gives two equations with unknowns c1 and c2.

N1 .  p = d 1 = c 1  N1 .  N1 + c 2  N1 .  N2

N2 . p = d2 = c1 N1 . N2 + c2 N2 . N2

Solving for c1 and c2

c 1 = ( d 1  N2 .  N2 - d 2  N1 .  N2 ) / determinant

c2 = ( d2 N1 . N1 - d1 N1 . N2) / determinant

determinant = ( N1 . N1 ) ( N2 . N2 ) - ( N1 . N2 )2

Note that a test should first be performed to check that the planes aren't parallel or coincident (also parallel), this is most easily achieved by checking that the cross product of the two normals isn't zero. The planes are parallel if

N1 *  N2 = 0




Intersection of three planes

Written by  Paul Bourke
October 2001

A contribution by Bruce Vaughan in the form of a Python script for the SDS/2 design software: P3D.py.

The intersection of three planes is either a point, a line, or there is no intersection (any two of the planes are parallel).

The three planes can be written as

N1 .  p = d 1

N2 . p = d2

N3 . p = d3

In the above and what follows, "." signifies the dot product and "*" is the cross product. The intersection point P is given by:

 d1 ( N2 * N3 ) + d2 ( N3 * N1 ) + d3 ( N1 * N2 )
P =-------------------------------------------------------------------------
 N1 . ( N2 * N3 )

The denominator is zero if N2 * N3 = 0, in other words the planes are parallel. Or if N1 is a linear combination of N2 andN3.




Equation of a line in polar coordinates

Written by  Paul Bourke
March 2013

How might one represent a line in polar coordinates?
In cartesian coordinates it can be represented as:

The derivation is quite straightforward once one realises that for a point (r, theta) the x axis is simply r cos(theta) and the y axis is r sin(theta). Substituting those into the equation for the line gives the following result.

Example from the Graphing Calculator.

From: http://paulbourke.net/geometry/pointlineplane/

generate point cloud for kf 38, size=11811 DEBUG: Starting Frame constructor, detect_result size: 4 DEBUG: Before dynamic checking, N = 1532 DEBUG: Starting feature point filtering DEBUG: After filtering, N = 1034 Plane 1 detected with 116 points Plane 2 detected with 120 points Plane 3 detected with 137 points Plane 4 detected with 272 points Plane 5 detected with 205 points Plane 6 detected with 126 points Plane 7 detected with 313 points Plane 8 detected with 341 points Plane 9 detected with 617 points Plane 10 detected with 213 points Plane 11 detected with 152 points Plane 12 detected with 2404 points Plane 13 detected with 525 points Extracted 11 planes outside boxes Extracted 10 lines between planes Line 1 connects plane 0 and plane 8 Line 4 connects plane 0 and plane 6 Line 5 connects plane 1 and plane 3 Line 8 connects plane 2 and plane 4 DEBUG: Frame constructor completed successfully === STARTING PoseOptimizationWithPlanesAndLines === Optimizer initialized Camera vertex added: 1, Vertex count: 1, Edge count: 0 Processing 1034 point features Added 257 point feature edges Number of planes to process: 11 Added 11 plane edges === 线特征数组大小检查 === mvLines.size() = 10 mvLineWorldPoints.size() = 0 mvbLineValid.size() = 10 ========================== WARNING: 线特征数组大小不匹配!实际处理 0 条线(预期 10 条) Added 0 line edges Starting optimization with 1 vertices and 268 edges Optimization completed successfully. Inliers: 162/257 === FINISHED PoseOptimizationWithPlanesAndLines === receive a keyframe, id = 39 Warning: No plane coefficients in KeyFrame 39
最新发布
12-13
sample_object_model_3d (Operator) Name sample_object_model_3d — Sample a 3D object model. Signature sample_object_model_3d( : : ObjectModel3D, Method, SamplingParam, GenParamName, GenParamValue : SampledObjectModel3D) Description sample_object_model_3d creates a sampled version of the 3D object model ObjectModel3D and returns it in SampledObjectModel3D. Depending on the method used, SamplingParam controls the minimum distance or the number of points in SampledObjectModel3D. The created 3D object model is returned in SampledObjectModel3D. Using sample_object_model_3d is recommended if complex point clouds are to be thinned out for faster postprocessing or if primitives are to be converted to point clouds. Note that if the 3D object model is triangulated and should be simplified by preserving its original geometry as good as possible, simplify_object_model_3d should be used instead. If the input object model ObjectModel3D contains only points, several sampling methods are available which can be selected using the parameter Method: 'fast': The default method 'fast' adds all points from the input model which are not closer than SamplingParam to any point that was earlier added to the output model. If present, normals, XYZ-mapping and extended point attributes are copied to the output model. 'fast_compute_normals': The method 'fast_compute_normals' selects the same points as the method 'fast', but additionally calculates the normals for all points that were selected. For this, the input object model must either contain normals, which are copied, or it must contain a XYZ-mapping attribute from which the normals are computed. The z-component of the calculated normal vectors is always positive. The XYZ-mapping is created by xyz_to_object_model_3d. 'accurate': The method 'accurate' goes through the points of the 3D object model ObjectModel3D and calculates whether any other points are within a sphere with the radius SamplingParam around the examined point. If there are no other points, the original point is stored in SampledObjectModel3D. If there are other points, the center of gravity of these points (including the original point) is stored in SampledObjectModel3D. This procedure is repeated with the remaining points until there are no points left. Extended attributes of the input 3D object model are not copied, but normals and XYZ-mapping are copied. For this method, a noise removal is possible by specifying a value for 'min_num_points' in GenParamName and GenParamValue, which removes all interpolated points that had less than the specified number of neighbor points in the original model. 'accurate_use_normals': The method 'accurate_use_normals' requires normals in the input 3D object model and interpolates only points with similar normals. The similarity depends on the angle between the normals. The threshold of the angle can be specified in GenParamName and GenParamValue with 'max_angle_diff'. The default value is 180 degrees. Additionally, outliers can be removed as described in the method 'accurate', by setting the generic parameter 'min_num_points'. 'xyz_mapping': The method 'xyz_mapping' can only be applied to 3D object models that contain an XYZ-mapping (for example, if it was created using xyz_to_object_model_3d). This mapping stores for each 3D point its original image coordinates. The method 'xyz_mapping' subdivides those original images into squares with side length SamplingParam (which is given in pixel) and selects one 3D point per square. The method behaves similar to applying zoom_image_factor onto the original XYZ-images. Note that this method does not use the 3D-coordinates of the points for the point selection, only their 2D image coordinates. It is important to notice that for this method, the parameter SamplingParam corresponds to a distance in pixels, not to a distance in 3D space. 'xyz_mapping_compute_normals': The method 'xyz_mapping_compute_normals' selects the same points as the method 'xyz_mapping', but additionally calculates the normals for all points that were selected. The z-component of the normal vectors is always positive. If the input object model contains normals, those normals are copied to the output. Otherwise, the normals are computed based on the XYZ-mapping. 'furthest_point': The method 'furthest_point' iteratively adds the point of the input object to the output object that is furthest from all points already added to the output model. This usually leads to a reasonably uniform sampling. For this method, the desired number of points in the output model is passed in SamplingParam. If that number exceeds the number of points in the input object, then all points of the input object are returned. The first point added to the output object is the point that is furthest away from the center of the axis aligned bounding box around the points of the input object. 'furthest_point_compute_normals': The method 'furthest_point_compute_normals' selects the same points as the method 'furthest_point', but additionally calculates the normals for all points that were selected. The number of desired points in the output object is passed in SamplingParam. To compute the normals, the input object model must either contain normals, which are copied, or it must contain a XYZ-mapping attribute from which the normals are computed. The z-component of the calculated normal vectors is always positive. The XYZ-mapping is created by xyz_to_object_model_3d. If the input object model contains faces (triangles or polygons) or is a 3D primitive, the surface is sampled with the given distance. In this case, the method specified in Method is ignored. The directions of the computed normals depend on the face orientation of the model. Usually, the orientation of the faces does not vary within one CAD model, which results in a set of normals that is either pointing inwards or outwards. Note that planes and cylinders must have finite extent. If the input object model contains lines, the lines are sampled with the given distance SamplingParam. The sampling process approximates surfaces by creating new points in the output object model. Therefore, any extended attributes from the input object model are discarded. For mixed input object models, the sampling priority is (from top to bottom) faces, lines, primitives and points, i.e., only the objects of the highest priority are sampled. The parameter SamplingParam accepts either one value, which is then used for all 3D object models passed in ObjectModel3D, or one value per input object model. If SamplingParam is a distance in 3D space the unit is the usual HALCON-internal unit 'm'. Execution Information Multithreading type: reentrant (runs in parallel with non-exclusive operators). Multithreading scope: global (may be called from any thread). Processed without parallelization. This operator supports canceling timeouts and interrupts. Parameters ObjectModel3D (input_control) object_model_3d(-array) → (handle) Handle of the 3D object model to be sampled. Method (input_control) string → (string) Selects between the different subsampling methods. Default: 'fast' List of values: 'accurate', 'accurate_use_normals', 'fast', 'fast_compute_normals', 'furthest_point', 'furthest_point_compute_normals', 'xyz_mapping', 'xyz_mapping_compute_normals' SamplingParam (input_control) real(-array) → (real / integer) Sampling distance or number of points. Number of elements: SamplingParam == 1 || SamplingParam == ObjectModel3D Default: 0.05 GenParamName (input_control) string-array → (string) Names of the generic parameters that can be adjusted. Default: [] List of values: 'max_angle_diff', 'min_num_points' GenParamValue (input_control) number-array → (real / integer / string) Values of the generic parameters that can be adjusted. Default: [] Suggested values: 1, 2, 5, 10, 20, 0.1, 0.25, 0.5 SampledObjectModel3D (output_control) object_model_3d(-array) → (handle) Handle of the 3D object model that contains the sampled points. Number of elements: SampledObjectModel3D == ObjectModel3D
09-14
给出平均每家临街距离The plots, courtyards, and rooms include many variants. To be able to generate the variants, in the generation process the application of some rules could be altered by each other. The Hutong Neighbourhood Grammar is a parametric shape grammar. Focusing on the plan view, this grammar is defined in the Cartesian product of algebras: U12 × (V02 × V12 × V22). Shapes in algebras U12 include lines to represent the boundaries of Siheyuan plots and alleys. Labels are alphanumeric characters attached to a shape to represent additional information about the shape, which are employed to identify the available rules to be applied to the shape (Stiny, 1980). Shapes in algebras V02 include labelled points to represent the central point of a room plan and the midpoint of an edge of a room plan or a courtyard plan; shapes in algebras V12 include labelled line segments to represent the edge of Siheyuan plot, courtyard, and room; and shapes in algebras V22 include labelled plane segments to represent the plan of Siheyuan plot, courtyard, and room. In the rules, variables are introduced to control the generation of variants. For clarity, labels are used in the form of points, lines, or planes to mark the geometries in assistance in the derivation process, which are deleted once the generation is finished. The grammar describes the iteration of plots from Yuan to Qing dynasties and the generation of Siheyuan on the Qianlong Capital Map in a top-down fashion by dividing and iterating shapes representing the plots and courtyards and adding shapes representing rooms and gates. Corresponding to the historical planning of Hutong neighbourhoods, the generation process followed the steps: 1) generating the Hutong neighbourhood and dividing the neighbourhood into Siheyuan plots, 2) iterating Siheyuan plots, 3) dividing plots into courtyards and defining their types, 4) iterating courtyard, 5) defining room layout pattern and locating rooms and walls. Fig. 3 demonstrates the workflow of the grammar, the rules that could be applied in each step, and the shapes for this grammar. It is noted there are branches in some steps, which case variants of Siheyuan. In the grammar, the rectangles represent neighbourhoods, plots, sub-plots, courtyards, and rooms. The letters in the rectangles are employed to distinguish types of sub-plots and courtyards, and colours of rectangles are used to distinguish types of rooms. The black solid line segments represent the Siheyuan walls and the black dash line segments represent the courtyard walls. Fig. 3 Download: Download high-res image (905KB) Download: Download full-size image Fig. 3. The workflow and the shapes of the grammar. 3.1. Generation of Hutong neighbourhoods plan and Siheyuan plots As recorded in ancient literature such as Kao Gong Ji, an ideal Chinese city should be planned in a square shape to conform to the concept of “round sky and square earth (tian yuan di fang)”. When rebuilt by the Mongols in 1264, the scheme of Beijing was planned in a rectangular shape, which was close to the set forth by the Chinese philosophers. On this rectangular city plan, the urban neighbourhoods were also rectangular, enclosed by the south-north and east-west oriented streets, which caused an orthogonal grid system. This urban system passed through Yuan, Ming, and Qing dynasties and survived into the last century (Steinhardt, 1990). Zhao (1972) pointed out that, when Beijing was rebuilt in the Yuan dynasty, each neighbourhood's depth (length in south–north orientation) was planned to be 67.76 m and its width (length in east-west orientation) was 677.6 m. The Hutong alley between two adjacent neighbourhoods was 9.24 m wide. These key urban elements and dimensions are determining the initial shapes of the Hutong grammar. Each neighbourhood was averagely divided into ten plots aligned in an east–west orientation. We defined these neighbourhoods as “Type A Neighbourhood” (TAN). It is noted that some TANs were replanned in the Qing dynasty. Specifically, in the south-north orientation, two adjacent neighbourhoods were combined as a whole and were divided into three new neighbourhoods, with an alley between each of the two adjacent new neighbourhoods. We defined these new neighbourhoods as “Type B Neighborhoods” (TBN). The neighbourhoods planned in the Yuan dynasty (TAN) were divided into 67.67 m × 67.67 m Siheyuan plots. Although the development of neighbourhoods in the Qing dynasty changed the depth of both Siheyuan plots and neighbourhoods, the width remained. Two 67.76 × 677.6 m2 neighbourhood plans, represented by two rectangles are placed on a two-dimensional (XY) coordinate system, which is defined as the initial shape. On the XY coordinate system, the X-axis is defined as the east-west orientation and the Y-axis is defined as the north-south orientation, and the origin (0, 0) is on the southwest vertex of the south neighbourhood plan. Rule R1 describes the transformation of neighbourhoods from two TANs with one alley to three TBNs with two alleys. Variables associated with the rules are the neighbourhood depth (Nd) and the alley width (Aw), whose values are smaller than the original neighbourhood depth and alley width. Rules R2 describe the division of a TAN or a TBN neighbourhood into Siheyuan plots, represented by squares. Rules R1–R2 are shown in Fig. 4. Fig. 4 Download: Download high-res image (242KB) Download: Download full-size image Fig. 4. Rule R1 transforms TAN to TBN and Rule R2 divides a TAN or TBN into plots. 3.2. Siheyuan plots iteration It is noted the plots experienced iterations in various modes in Yuan, Ming, and Qing dynasties, which result in Siheyuan variants shown on the Qianlong Capital Map. 3.2.1. Division of plots into sub-plots A Siheyuan plot in the Yuan dynasty could be divided into two to four sub-plots in the east-west orientation. Each sub-plot could include several courtyards aligned in south-north orientation (Type A sub-plot, TASP) or empty space (Type B sub-plot, TBSP). We categorized six dividing patterns of a plot, by which the plot is divided into one or two sub-plot types. We found that the width of a TASP is normally around 12–35 m, while most TBSPs are close to or narrower than TASPs but wider than 5 m. Therefore, for simplification, we define the value of the parameter TASPw, the width of a TASP, which ranges from 12 to 35 m, and the value of the parameter TASPw, the width of a TBSP, from 5 to 12 m. The six division patterns of the plots are defined as Rules R3a to R3f respectively. In Fig. 5, Rule R3a divides a plot into two TASPs, and R3b divides a plot into three TASPs. Rule R3c and R3e describe three modes of dividing a plot into two TASPs and one TBSP. The difference between them is the location of the TBSP, which are in the east, west, and mid respectively. Rule 3f describes that a plot is divided into four sub-plots: two TASPs in the mid and a TBSP in the east and west respectively. In these rules, north-south orientated line segments are inserted into the plots to generate new rectangles on the XY plane to represent sub-plots. To locate these line segments, the variables, width of TASP (TASPw) and width of TBSP (TBSPw), are used for description. Fig. 5 Download: Download high-res image (479KB) Download: Download full-size image Fig. 5. Rule R3 divides a plot into sub-plots. Fig. 6 Download: Download high-res image (120KB) Download: Download full-size image Fig. 6. Rule R4 combines sub-plots to become a new sub-plot. 3.2.2. Sub-plot combination Some TASPs and TBSPs were combined to recreate new sub-plots. It is noted some sub-plots were additionally developed into new forms. As the historical material (E, 1739) recorded, to relieve the stress of the increase of the population of Beijing in the Qing dynasty, the government advocated using empty spaces to construct dwellings. It is noted that, since the width of TBSPs was usually too narrow to construct Siheyuan and many Siheyuans on TASPs were dilapidated or derelict due to the change of dynasty, some TASPs and TBSPs were combined to recreate new sub-plots. According to Liu's (2019) investigation of selected Siheyuan examples shown on the Qianlong Capital Map, we inferred the principles that one TASP could be combined with one adjacent TBSP to become a combined sub-plot, called Type AB sub-plot (TABSP). Then the TABSP could be used to construct a Siheyuan with a side courtyard. Since the TABSPs are wider than other types, it enables a Siheyuan to be built on the plot with two courtyards in the east-west orientation. Normally, on a TABSP, a set of courtyards are aligned in a south-north orientation, with a side courtyard next to these courtyards in parallel and connecting the south and north sub-plot boundaries. Rule R4a and R4b describe how a TASP and a TBSP combine to become a TABSP, as shown in Fig. 6. The difference between them is the locations of the TASP and the TBSP. On the right side of the rule, the line segment between the two sub-plots is removed and two rectangles are merged to become a new rectangle, representing the TABSP. The summation of the variables TASPw and TBSPw is the width of TABSP (TABSPw). 3.2.3. Sub-plot disaggregation and recombination The Siheyuan housings with a side courtyard were rare and usually belonged to upper-class owners in ancient times. In many cases, the TABSP disaggregates into many smaller sub-plots, called a Type ABd sub-plot (TABdSP), on which a one-courtyard Siheyuan is constructed. The disaggregation may also happen to some TASPs, whose disaggregated sub-plot is called a Type Ad sub-plot (TAdSP). Two TABdSPs or two TAdSPs adjacent in north-south orientation may be recombined to become a new sub-plot, called Type Ad2 sub-plot (TAd2SP) and Type ABd2 sub-plot (TABd2SP) respectively. In the disaggregation, the number of generated TAdSPs or TABdSPs in a north-south orientation, constrained by the depth of the neighbourhood, is 3 or 4 in most cases. For simplification, we assume it is 4 in TANs and 3 in TBNs. The number in the east-west orientation, constrained by the width of the sub-plot, is 2 or 3 mostly. We define it as 3 if the width is more than 20 m, otherwise 2. These Siheyuans built on disaggregated sub-plots are clustered, in which some Siheyuans are not on street. To create access to these Siheyuans, the west and east edges of disaggregated sub-plots that are adjacent in the east-west orientation, shrink to give space to generate a small south-north oriented alley. The alley might, or might not, cross the neighbourhood to connect the alleys on the south and north side of the neighbourhood. To simplify, we assume that an alley crosses the neighbourhood in this grammar. For 2 × 3 and 2 × 4 disaggregated sub-plots, an alley is generated by shrinking the sub-plot edges. 3 × 3 and 3 × 4 cases could be considered subplots in three rows aligned in parallel in the north-south orientation. For the pattern of three rows, it is unusual to generate an alley between every two adjacent rows. Alternatively, one small alley is generated between two rows in the way the same as the rules of 2 × 3 or 2 × 4 disaggregated sub-plots. For the third row of sub-plots that are not adjacent to the alley, if there are four sub-plots in the rest row, they will recombine to become two TAd2SPs/TABd2SPs, and if there are three sub-plots, two adjacent sub-plots will recombine to become a TAd2SPs/TABd2SP, both of which ensure each sub-plot to have access to the urban fabric. In the shrinkage, the movement distance of each sub-plot edge is slightly different, which makes the alley geometrically irregular. Except for the above disaggregation, there was another mode that a TASP separates into two sub-plots. Historically, a TASP was usually used to construct a three-courtyard Siheyuan or a four-courtyard Siheyuan, whose courtyards were aligned in a row in the north-south orientation. In this mode, the TASP separates by dividing the boundary of the second and the third courtyard, in which the original type of each courtyard remains. We call the separated sub-plot on the south side as the Type ASS sub-plot (TASSSP) and the one on the north as the Type ASN sub-plot (TASNSP). Rule R5 defines the disaggregation of a TASP and a TABSP. Considering the variants caused by neighbourhood depth and width, the rule includes variants Rule R5a-d. Line segments are introduced to indicate the edges of new sub-plots after the disaggregation of a TASP or a TABSP. In Rule R5a, two east-west orientated line segments and one north-south line segment are inserted to divide the TASP into 2 × 3 TAdSPs. In Rule R5b, there is one more east-west orientated line segment, enabling the generation of 2 × 4 TAdSPs. In Rule R5c, two east-west segments and two north-south segments are inserted to divide the plot into 3 × 3 TABdSPs. And in Rule R5d, one more east-west orientated segment than in R5c is introduced to divide the plot into 3 × 4 TABdSPs. The location of each line segment is important since they determine the size of each generated subplot. To describe them, including the inserted north-south orientated line segments and the line segments representing the east and west edges of the plot, the distances between each two of them are defined as w1, w2, and w3 from west to east. And the distances between each two east-west orientated line segments, including the ones representing the north and south edges of the plot and the inserted ones, are defined as d1, d2, d3, and d4 from south to north. These distances are variables to control the disaggregation. Rule R6 describes the generation of a small alley between two north-south orientated rows, which includes two variations. In Rule R6a, six TAdSPs or TABdSPs are clustered in two north-south orientated rows (2 × 3 mode) on the left of the rule. The shared edges of each two adjacent sub-plots in the west and east are labelled as thick line segments. On the right of the rule, for each segment, two copies of it are generated by offsetting itself in the east and west in the mirror using the segment as an axis, which are the boundaries between sub-plots and the small alley edge fragment. The distances describing the width of the small alley fragments (SAw1, SAw2, and SAw3) are variables in this rule. In Rule R6b, there are eight TAdSPs or TABdSPs clustered in two north-south orientated rows (2 × 4 mode). The generation of each small alley fragment is the same. The small alley fragments may move in the east-west orientation. Rule R7 is introduced to simulate the movement. In Rule R7, each pair of line segments moves in the east-west orientation using its mirror axis as an indicator. The displacement is a variable, (SAm1, SAm2, SAm3, and SAm4) in the east-west orientation, and the movement toward the east is positive (+x) and toward the west is negative (-x). The same as Rule R6, Rule R7 has two variations corresponding to the two clustered sub-plot modes. Rule R8 introduces the recombination of two TABdSPs or two TAdSPs, which normally happen to sub-plots that have no access to the urban fabric. In this rule, the shared edge of the two sub-plots adjacent in north-south orientation is removed and the two sub-plots are merged. Considering the disaggregation patterns and sub-plots locations, it includes three variations. Rule R8a-R8c. Rule R9 describes the division of a TASP into a TASNSP and a TASSSP. In the rule, an east-west line segment is inserted into the rectangle, whose variable is the depth of the TASSSP. Rules R5-R9 are shown in Fig. 7. Fig. 7 Download: Download high-res image (722KB) Download: Download full-size image Fig. 7. Rules R5-R9 define the disaggregation and recombination of sub-plots.
06-25
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值