pazdera / libcity Goto Github PK
View Code? Open in Web Editor NEWA C++ library for procedural generation of cities and large urban environments.
Home Page: http://p-g-c.blogspot.com/
License: GNU General Public License v3.0
A C++ library for procedural generation of cities and large urban environments.
Home Page: http://p-g-c.blogspot.com/
License: GNU General Public License v3.0
Add checking of the minimal distance between intersections to generating algorithm (RoadLSystem).
The following road configuration in StreetGraph causes infinite recursion after calling findZones().
map->addRoad(Path(Line(Point(0,0), Point(100,100))));
map->addRoad(Path(Line(Point(300,500), Point(100,100))));
map->addRoad(Path(Line(Point(300,300), Point(200,400))));
StreetGraph has 6 intersections and 8 roads.
http://www.stud.fit.vutbr.cz/~xpazde00/soubory/screenshot04182011_113609388.jpg
Expected behavior:
Create 0 zones.
Segfault at
==12881== Use of uninitialised value of size 4 ==12881== at 0x46D77AC: Point::x() const (point.h:56) ==12881== by 0x46D7ADE: Point::Point(Point const&) (point.cpp:34) ==12881== by 0x46DAFC0: Ray::origin() const (ray.cpp:84) ==12881== by 0x46DB1ED: Ray::intersection2D(Ray const&, Point*) const (ray.cpp:102) ==12881== by 0x8059081: OgreCity::precomputeIntersectionsVertices() (ogrecity.cpp:627) ==12881== by 0x805B973: OgreCity::drawRoadNetwork() (ogrecity.cpp:77) ==12881== by 0x46F59F9: City::draw() (city.cpp:52) ==12881== by 0x806A7C9: City3D::createScene() (city3d.cpp:66) ==12881== by 0x805F826: BaseApplication::setup() (baseapplication.cpp:233) ==12881== by 0x805FE97: BaseApplication::go() (baseapplication.cpp:202) ==12881== by 0x806AED8: main (main.cpp:26) ==12881== ==12881== Invalid read of size 8 ==12881== at 0x46D77AC: Point::x() const (point.h:56) ==12881== by 0x46D7ADE: Point::Point(Point const&) (point.cpp:34) ==12881== by 0x46DAFC0: Ray::origin() const (ray.cpp:84) ==12881== by 0x46DB1ED: Ray::intersection2D(Ray const&, Point*) const (ray.cpp:102) ==12881== by 0x8059081: OgreCity::precomputeIntersectionsVertices() (ogrecity.cpp:627) ==12881== by 0x805B973: OgreCity::drawRoadNetwork() (ogrecity.cpp:77) ==12881== by 0x46F59F9: City::draw() (city.cpp:52) ==12881== by 0x806A7C9: City3D::createScene() (city3d.cpp:66) ==12881== by 0x805F826: BaseApplication::setup() (baseapplication.cpp:233) ==12881== by 0x805FE97: BaseApplication::go() (baseapplication.cpp:202) ==12881== by 0x806AED8: main (main.cpp:26) ==12881== Address 0x0 is not stack'd, malloc'd or (recently) free'd ==12881== ==12881== ==12881== Process terminating with default action of signal 11 (SIGSEGV) ==12881== Access not within mapped region at address 0x0 ==12881== at 0x46D77AC: Point::x() const (point.h:56) ==12881== by 0x46D7ADE: Point::Point(Point const&) (point.cpp:34) ==12881== by 0x46DAFC0: Ray::origin() const (ray.cpp:84) ==12881== by 0x46DB1ED: Ray::intersection2D(Ray const&, Point*) const (ray.cpp:102) ==12881== by 0x8059081: OgreCity::precomputeIntersectionsVertices() (ogrecity.cpp:627) ==12881== by 0x805B973: OgreCity::drawRoadNetwork() (ogrecity.cpp:77) ==12881== by 0x46F59F9: City::draw() (city.cpp:52) ==12881== by 0x806A7C9: City3D::createScene() (city3d.cpp:66) ==12881== by 0x805F826: BaseApplication::setup() (baseapplication.cpp:233) ==12881== by 0x805FE97: BaseApplication::go() (baseapplication.cpp:202) ==12881== by 0x806AED8: main (main.cpp:26)
Fillament roads are just removed by Minimal Cycle Basis algorithm and not considered while making blocks and lots. This results in an occasional road underneath a building.
Dude, there's no source code available in this project.
It would be nice to consider staged installs and make the Makefile
support this convention.
Secondary road generating is too slow. Most probably due to wrong L-System interpreting algorithm.
Block extraction algorithm produces in some situations unsatisfying results. See http://www.stud.fit.vutbr.cz/~xpazde00/soubory/bad_areas.png
This roads in StreetGraph causes fail while creating 3way intersection.
map->addRoad(Path(LineSegment(Point(-300.988, -1852.79, 0), Point(-228.946, -1688.77, 0)))); map->addRoad(Path(LineSegment(Point(-198.41, -1666.19, 0), Point(-228.946, -1688.77, 0)))); map->addRoad(Path(LineSegment(Point(-228.946, -1688.77, 0), Point(-201.985, -1627.38, 0))));
city3d: /home/astro/MyBook/Skola/BP/code/3d/src/ogrecity.cpp:687: void OgreCity::precomputeIntersectionsVertices(): Assertion `intersectionResult == Line::INTERSECTING' failed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.