Posts

Showing posts with the label Circle Packing

Analyzing 3 Body Problem in GNU Emacs

Image
Node view (left) and Group view (right)     3 Body Problem is a sci-fi series on Netflix. Though this post is more about the analyzing process in GNU Emacs than about the show storyline. This is a work-in-progress . The entry point to the package is M-x graph-brain . Design Decisions Leaf title will be displayed at the center of the circle. If it has an image, it will be displayed at the bottom. Group title is displayed at the top. Information gets fuzzier at a certain density. Around 16 leaves and three levels - root, groups and leaves - seems to be a comfortable threshold. org-roam is being used for the database. Presently, only ID, title, filetags and  link fields are being used. IMAGE is managed as an org-mode property.   The Shape We don't want to restrict the number of characters in the story. Yet we don't want to manually decide their placement on the screen. So we need a shape which can be easily placed based on geometrical calculations. The two simplest opt...

Circle Packing Animation in GNU Emacs

Image
  Here's an implementation of circle packing algorithm by Wang et. el. in Elisp. Front chain is the set of circles on the periphery. These are shown as connected by red line in the animation. (require 'graph-pack) (defstruct point x y r)   ;; Define a point (setq p (make-point :x 17 :y 0 :r 16))   ;; Define a list of points (setq points (list p1 p2))   ;; Image is an SVG image. This is used for drawing the animation (optional). The return value is the front chain. This can be further used to generate a circumscribing circle. (graph-pack points image)  ;; Get circumscribing circle (setq p (graph-enclose (graph-pack children)))   Bubble Graph   You can pass a hierarchical tree of points to generate a bubble graph. Only radii of leaf nodes are mandatory. title and fill parameters are used if provided. ;; For drawing additional point attributes are required. Hence this definition is different from above. Properties old-x and old-y are used internally. (de...