1. Context-Free Grammar

Definition − A context-free grammar (CFG) consisting of a finite set of grammar rules is a quadruple (N, T, P, S) where

  • N is a set of non-terminal symbols.

  • T is a set of terminals where N ∩ T = NULL.

  • P is a set of rules, P: N → (N ∪ T)*, i.e., the left-hand side of the production rule P does have any right context or left context.

  • S is the start symbol.

Example

  • The grammar ({A}, {a, b, c}, P, A), P : A → aA, A → abc.
  • The grammar ({S, a, b}, {a, b}, P, S), P: S → aSa, S → bSb, S → ε
  • The grammar ({S, F}, {0, 1}, P, S), P: S → 00S | 11F, F → 00F | ε

由上述语法可以构建对应的语法树,即Derivation Tree

2. Generation of Derivation Tree

A derivation tree or parse tree is an ordered rooted tree that graphically represents the semantic information a string derived from a context-free grammar.

Example

Let a CFG {N,T,P,S} be

N = {S}, T = {a, b}, Starting symbol = S, P = S → SS | aSb | ε

One derivation from the above CFG is “abaabb”

S → SS → aSbS → abS → abaSb → abaaSbb → abaabb

3. CGA Shape Grammar

Notation: Production rules are defined in the following form:

 id: predecessor : cond -> successor : prob

  • id is a unique identifier for the rule;
  • predecessor ∈ V is a symbol identifying a shape that is to be replaced with successor;
  • cond is a guard (logical expression) that has to evaluate to true in order for the rule to be applied.
  • The rule is selected with probability prob.

3.1 Scope rules:

平移向量T: T(tx, ty, tz) is a translation vector that is added to the scope position P;

旋转向量R: Rx(angle), Ry(angle), and Rz(angle) rotate the respective axis of the coordinate system;

尺寸向量S: S(sx,sy,sz) sets the size of the scope;

类别I: I(ob jId). Typical objects include a cube, a quad, and a cylinder, but any threedimensional model can be used.

3.2 Basic split rule:

规则1:对fac立面在Y轴上进行分割,分割尺寸为3.5m, 0.3m,3m,3m,3m,形状类别为floor,ledge, floor, floor,floor。 也可以是multiple axis (”XY”, ”XZ”,”YZ”, or ”XYZ”), nested splits, or nested combinations of splits and L-system rules。

3.3 Scaling of rules:

上图figure4 右图给出了两种尺寸设计(with x-length 12 and 10):

S(12,3) 和 S(10,3)

再使用3.2的分割规则,将其分为BAAB shape, 分割方向为X轴,长度为,2, lr, lr, 2.

3.4 Repeat: tile a specified element.

对floor进行平铺填充,填充物为B形状,填充方向为X轴方向,填充个数为: repetitions = [Scope.sx/2]

所以2是填充间隔?

原文:“The floor will be tiled into as many elements of type B along the x-axis of the scope as there is space. The number of repetitions is computed as repetitions = ⌈Scope.sx/2⌉ and we adjust the actual size of the element accordingly.”

3.5 Component split:

在type物体上构建诸如A,B...Z等component。

type identifies the type of the component split with associated parameters param (if any).

For example:

  1. Comp(”faces”){A} means creating a shape with symbol A for each face of the original three-dimensional shape.
  2. Comp(”edge”,3){A} means creating a shape A aligned with the third edge of the model.

4. Mass Modeling

如何使用上述规则生产模型?

4.1 初级生产水平:以一个box为起始或基础,使用平移规则、尺寸规则、分割规则等生成一些简单的模型,比如basic building blocks L, H, U and T。

4.2 对简单物体加入一些旋转操作。

The next level of difficulty is to use arbitrary rotations of shapes and to include a cylinder in the shape vocabulary.

4.3 一些屋顶类型

Further, it becomes necessary to include basic roof shapes, such as the examples depicted in figure 7 and more general shapes, such as general L-shapes and extruded general quadrilaterals.

4.4 Problem of complex surfaces:

4.5 Modeling strategy:

1) use three dimensional scopes to place three-dimensional shapes (volumes) to form a mass model.

2)generate two-dimensional scopes aligned with facade surfaces and roof surfaces by extracting the faces of the three-dimensional shapes with a component split.

3) The grammar can then proceed to refine the resulting quads and triangles.

参考:

https://www.tutorialspoint.com/automata_theory/context_free_grammar_introduction.htm

Müller P, Wonka P, Haegler S, et al. Procedural modeling of buildings[M]//ACM SIGGRAPH 2006 Papers. 2006: 614-623.

Context-Free Grammar及形状规则集相关推荐

  1. 模式识别之Shape Context---利用Shape Context进行形状识别

     什么是Shape Context Shape Context是一个用于形状识别的,非常经典的特征(一串便于计算机处理的数字)提取方法,它由Serge Belongie和Jitendra Malik  ...

  2. 利用Shape Context进行形状识别

          什么是Shape Context Shape Context是一个用于形状识别的,非常经典的特征(一串便于计算机处理的数字)提取方法,它由Serge Belongie和Jitendra M ...

  3. 形状文法--建筑风格分类总结

    1.Shape –Talking about seeing and doing(田小娣) 在Stiny George的Shape-Talking about seeing and doing文章中,S ...

  4. 自然语言处理(NLP)-统计句法分析(CKY算法用于PCFG下的句法分析)

    1.先解释何为CFG及PCFG: 一个栗子: 2.CKY算法(或称CYK算法) "在计算机科学领域,CYK算法(也称为Cocke–Younger–Kasami算法)是一种用来对 上下文无关文 ...

  5. 递归皮层网络RCN识别文本CAPTCHAS的Science论文基础知识和译文 (公号回复“递归皮层网络”可下载PDF典藏版资料)

    递归皮层网络RCN识别文本CAPTCHAS的Science论文基础知识和译文 (公号回复"递归皮层网络"可下载PDF典藏版资料) 原创: 秦陇纪 数据简化DataSimp 今天 数 ...

  6. 翻译:浏览器内部的工作原理

    译文:引自http://www.html5rocks.com/en/tutorials/internals/howbrowserswork/ 作为一名web开发人员,了解浏览器的内部运作会帮助你做出更 ...

  7. 前端必读:浏览器内部工作原理

    前端必读:浏览器内部工作原理 作者: Tali Garsiel  发布时间: 2012-02-09 14:32  阅读: 2133 次  原文链接   全屏阅读  [收藏]   http://kb.c ...

  8. Browser Page Parsing Details

    Browser Work: 1.输入网址.  2.浏览器查找域名的IP地址.  3. 浏览器给web服务器发送一个HTTP请求  4. 网站服务的永久重定向响应  5. 浏览器跟踪重定向地址 现在,浏 ...

  9. 浏览器是如何工作的?(转载)

    文章引用地址:http://www.iefans.net/liulanqi-ruhe-gongzuo-yuanli/ 作者:iefans 简介 浏览器可以被认为是使用最广泛的软件,本文将介绍浏览器的工 ...

最新文章

  1. Django源码分析2:本地运行runserver分析
  2. 【竞赛经验分享】2020腾讯广告算法大赛:如何突破分数瓶颈?
  3. Fragment结合nineold包实现滑动tab页
  4. 如何开发一个异常检测系统:异常检测 vs 监督学习
  5. 大创中期报告怎么写_课题研究中期报告怎么写?这篇范文很说的很详细
  6. kubernetes管理mysql_kubernetes云平台管理实战:tomcat + mysql(十二)
  7. 联想乐云记事2.0高调发布 新增智能语音识别 [多平台]
  8. C语言--职工信息管理系统(含论文)
  9. 如何在论文中正确引用参考文献(自动标注)
  10. java servlet mysql_servlet+mysql实现简易的登录功能
  11. Win10无法访问移动硬盘怎么解决
  12. 用创业舞动飞扬的青春
  13. 《Ext JS 6.2实战》节选——迁移管理模版
  14. CactiEZ虚拟机安装
  15. 如何提取到网页上播放的视频
  16. http://ac.jobdu.com/problem.php?pid=1020
  17. 深度学习训练营第6周好莱坞明星人脸识别
  18. 初识webGIS库—OpenLayers
  19. 曲柄滑块机构运动分析和参数优化
  20. 缺乏标准化会减缓物联网的发展吗?

热门文章

  1. Web滚动字幕(MARQUEE示例)
  2. 《简洁记账》产品浅析
  3. 安装部署Ceph Calamari
  4. [28期] 坚定信念,抗战二十年
  5. 你若安好便是晴天nbsp;---------…
  6. 学会善于总结,善于表达
  7. android 模拟器手机如何添加文件到sd卡?
  8. 在线修改http header
  9. 计算机开不了机怎么用u盘解决,电脑开不了机怎么重装系统实测操作
  10. 210222课堂整理(异常捕获和正则)