Giter VIP home page Giter VIP logo

mengeutils's People

Stargazers

 avatar  avatar  avatar  avatar

mengeutils's Issues

Roadmap builder - deleting agents fails

Trying to delete agents in the AgentContext causes the application to crash. Upon fixing it, make sure to update the documentation in roadmap_builder.md.

SCB files content

Hi! I'm using menge and your tools for my degree's final project. I've been searching for scb file format, but nothing found. Is there a standard of something like this of scb files?
I want to playback a menge scene with roadmapBuilder but the agent radius is not shown correctly. Menge don't seems to export this data in the scb file. I want to add this feature in menge and then add it in roadmapBuilder, and I was wondering if there is a correct way to do this.
Thank you. Best regards.

RoadmapBuilder -- smoothing vector fields crashes

Symptom

When attempting to smooth a vector field, it is common to crash (see below for example crash stack trace).

Diagnosis

The algorithm works by "clipping" region to be smoothed. It then creates a smoothed version of that region and then blends it into the actual region based on gaussian weights. The problem arises in smoothFieldRegion. Specifically, the comment here. Specifically, it uses a gaussian kernel to create a smoothed value for each cell. This encompasses data outside the region. If that extent goes beyond the actual extent of the vector field, bad things happen. The todo addresses (rather loosely) these bad things and admits that no particular design has been tackled. One of the symptoms of these "bad things", is that the smoothed region doesn't come back with the right size. No matter what other bad things happen, the smoothed region should be of the size requested.

Proposal

There are several ways to handle boundary conditions:

  • Treat everything as zero outside the domain.
  • Extend the field's boundary value out indefinitely as a constant value.
  • Extend the field's boundary value out by some form of polynomial extrapolation.
  • Used periodic boundary conditions.
    Of these options, the first (zero outside the domain) is the simplest. It means when smoothing "near" the perimeter, zeros will inherently be blended in. The next best option would simply be constant extrapolation. It's not immediately apparent how much trickier the latter is relative to the former, so either option is left on the table.

Example stack trace

Traceback (most recent call last):
  File "roadmapBuilder.py", line 436, in <module>
    main()
  File "roadmapBuilder.py", line 406, in main
    result = handleMouse( event, context, view, graph, obstacles, agents, field )
  File "roadmapBuilder.py", line 95, in handleMouse
    result = context.handleMouse( event, view )
  File "P:\e_drive\work\projects\objreader\RoadContext.py", line 123, in handleMouse
    return self.activeContext.handleMouse( event, view )
  File "P:\e_drive\work\projects\objreader\RoadContext.py", line 1324, in handleMouse
    result.combine( self.activeContext.handleMouse( event, view ) )
  File "P:\e_drive\work\projects\objreader\RoadContext.py", line 1432, in handleMouse
    self.doWork( (dX, dY ) )
  File "P:\e_drive\work\projects\objreader\RoadContext.py", line 1534, in doWork
    smoothStroke( self.field, self.smoothStrength, self.kernelSize, ( self.downX, self.downY ), self.brushPos, self.brushSize )
  File "P:\e_drive\work\projects\objreader\fieldTools.py", line 227, in smoothStroke
    smoothFromDistance( field, strength, kernelSize, minima, maxima, distances, radius )
  File "P:\e_drive\work\projects\objreader\fieldTools.py", line 260, in smoothFromDistance
    newVectors = weights * smoothed + ( 1 - weights ) * region
ValueError: operands could not be broadcast together with shapes (12,11,1) (11,11,2)

RoadmapBuilder - SCB context has various stepping errors

Error 1 - simple backwards step

Given an scb file (version 2.1) from the 4square demo, I can load the SCB via:

python roadmapBuilder.py -b ..\menge_fork\examples\core\4square\4squareS.xml -s ..\menge_fork\Exe\4square.scb

I can advance the time step as expected with the right-arrow key. But trying to back up a frame produces the error:

Error with keyboard event
        The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Error 2 - Step back from the end

Using the same SCB, if the frame is advanced to the end (by using the modifiers to move at a higher rate), trying to step back causes a crash with the message:

Error with keyboard event
        string is smaller than requested size

NOTE: This error does not seem to occur when one approaches the end with a single-frame step.

Documentation

Hi @curds01 , I got your link from the Menge crowd simulator repo, can you provide me the documentation of repo as well (email: [email protected]) ? in order to use Menge and also can you help me out to create my own simulation using menge and read the trajectories of these simulations?

Roadmap builder - roadmap graph needs a context

The mechanism for building a roadmap graph is not consistent with all the other tools. It needs to
be wrapped into a context for consistency. Upon fixing it, make sure to update the documentation in roadmap_builder.md.

Some problems encountered using ObjSlice.py

Hi, thanks for sharing your menge utilities with us.
I've been using ObjSlice to Slice the .obj file to create obstacles, it works really well on simple objects such as cube or tetrahedrold. But when I apply it to some complex obj file, I ran into some errors.
For example, for this obj file https://github.com/xiangyuanhang/files/blob/master/kitchen3_fisher.obj, if I set the parameter as follows:ObjSlice.py -i objfiles/kitchen3_fisher.obj -p 0 0 1 -0.5 -o 0421.xml. It reports this error:
ZeroDivisionError: float division by zero
And then if I set the parameter like this: ObjSlice.py -i objfiles/kitchen4_fisher.obj -p 0 0 1 -0.5 --segment -o 0421.xml , which means I want each segement to be a unique obstacle instead of connecting them as polygons.
But however, when I check the xml file it created, there are lots of points that have been counted more than once.
So I am wondering how does the program selects the point. And is it possible that this program could connect the related points and create a coresponding closed polygons? (For the moment, it reports the ZeroDivisionError: float division by zero error)
Thanks in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.