py4design.templaterulepalette module

class py4design.templaterulepalette.BaseTemplateRule

Bases: object

The base class for developing new template rule for analysing topologies in massing model. For more information please refer to Chen, Kian Wee, Patrick Janssen, and Leslie Norford. 2017. Automatic Generation of Semantic 3D City Models from Conceptual Massing Models. In Future Trajectories of Computation in Design, Proceedings of the 17th International Conference on Computer Aided Architectural Design Futures, pp 84 to 100. Istanbul, Turkey.

for_topo_type

The topological type the rule apply to: there are 7 topologies, vertex, edge, wire, face, shell, solid, compsolid, compound.

get_analysis_rule_obj_dict_list()

This function gets all the BaseAnalysisRule objects appended to this template rule.

add_analysis_rule(analysis_rule_obj, bool_condition)

This function adds BaseAnalysisRule object to this template rule and specify its bool condition for the analysis rule (either True or False).

Parameters:

analysis_rule_obj : implementation of the BaseAnalysisRule meta class

The analysis rule and condition of the template rule.

bool_condition : bool

True or False.

identify(occshape_attribs_obj_list, pycitygml_writer)

This function executes the analysis rule and identify the city object based on the condition set. e.g. if a shell is closed and within anopther shell boundary, the shell is a building.

Parameters:

occshape_attribs_obj_list : list of ShapeAttributes objects

The geometeries of the massing model to be identified.

pycitygml_writer : pycitygml.Writer class instance

The writer to write the identified city objects into CityGML.

class py4design.templaterulepalette.IdentifyBuildingMassings

Bases: py4design.templaterulepalette.BaseTemplateRule

An implementation of the BaseTemplateRule class for identifying the massing of buildings (LOD1).

for_topo_type

The rule applies to the shell topology.

get_analysis_rule_obj_dict_list()

This function gets all the BaseAnalysisRule objects appended to this template rule.

add_analysis_rule(analysis_rule_obj, bool_condition)

This function adds BaseAnalysisRule object to this template rule and specify its bool condition for the analysis rule (either True or False).

Parameters:

analysis_rule_obj : implementation of the BaseAnalysisRule meta class

The analysis rule and condition of the template rule.

bool_condition : bool

True or False.

identify(occshape_attribs_obj_list, pycitygml_writer)

This function executes the analysis rule and identify the city object based on the condition set. e.g. if a shell is closed and within anopther shell boundary, the shell is a building.

Parameters:

occshape_attribs_obj_list : list of ShapeAttributes objects

The geometeries of the massing model to be identified.

pycitygml_writer : pycitygml.Writer class instance

The writer to write the identified city objects into CityGML.

class py4design.templaterulepalette.IdentifyTerrainMassings

Bases: py4design.templaterulepalette.BaseTemplateRule

An implementation of the BaseTemplateRule class for identifying the massing of terrains (LOD1).

for_topo_type

The rule applies to the shell topology.

get_analysis_rule_obj_dict_list()

This function gets all the BaseAnalysisRule objects appended to this template rule.

add_analysis_rule(analysis_rule_obj, bool_condition)

This function adds BaseAnalysisRule object to this template rule and specify its bool condition for the analysis rule (either True or False).

Parameters:

analysis_rule_obj : implementation of the BaseAnalysisRule meta class

The analysis rule and condition of the template rule.

bool_condition : bool

True or False.

identify(occshape_attribs_obj_list, pycitygml_writer)

This function executes the analysis rule and identify the city object based on the condition set. e.g. if a shell is opened and not within anopther shell boundary, the shell is a terrain.

Parameters:

occshape_attribs_obj_list : list of ShapeAttributes objects

The geometeries of the massing model to be identified.

pycitygml_writer : pycitygml.Writer class instance

The writer to write the identified city objects into CityGML.

class py4design.templaterulepalette.IdentifyLandUseMassings

Bases: py4design.templaterulepalette.BaseTemplateRule

An implementation of the BaseTemplateRule class for identifying the massing of landuse plots (LOD1).

for_topo_type

The rule applies to the shell topology.

get_analysis_rule_obj_dict_list()

This function gets all the BaseAnalysisRule objects appended to this template rule.

add_analysis_rule(analysis_rule_obj, bool_condition)

This function adds BaseAnalysisRule object to this template rule and specify its bool condition for the analysis rule (either True or False).

Parameters:

analysis_rule_obj : implementation of the BaseAnalysisRule meta class

The analysis rule and condition of the template rule.

bool_condition : bool

True or False.

identify(occshape_attribs_obj_list, pycitygml_writer)

This function executes the analysis rule and identify the city object based on the condition set. e.g. if a shell is opened and within anopther shell boundary, the shell is a plot.

Parameters:

occshape_attribs_obj_list : list of ShapeAttributes objects

The geometeries of the massing model to be identified.

pycitygml_writer : pycitygml.Writer class instance

The writer to write the identified city objects into CityGML.

class py4design.templaterulepalette.IdentifyRoadMassings

Bases: py4design.templaterulepalette.BaseTemplateRule

An implementation of the BaseTemplateRule class for identifying the massing of landuse road network (LOD0).

for_topo_type

The rule applies to the edge topology.

get_analysis_rule_obj_dict_list()

This function gets all the BaseAnalysisRule objects appended to this template rule.

add_analysis_rule(analysis_rule_obj, bool_condition)

This function adds BaseAnalysisRule object to this template rule and specify its bool condition for the analysis rule (either True or False).

Parameters:

analysis_rule_obj : implementation of the BaseAnalysisRule meta class

The analysis rule and condition of the template rule.

bool_condition : bool

True or False.

identify(occshape_attribs_obj_list, pycitygml_writer)

This function executes the analysis rule and identify the city object based on the condition set. e.g. if an edge is within anopther shell boundary, the edge is a road.

Parameters:

occshape_attribs_obj_list : list of ShapeAttributes objects

The geometeries of the massing model to be identified.

pycitygml_writer : pycitygml.Writer class instance

The writer to write the identified city objects into CityGML.