latentspace.

Merry christmas

What is a fractal?

A fractal refers to a structure that geometrically expresses the concept of self-similarity, in which parts and wholes have the same shape. A fractal is a simple structure that repeats endlessly to form a complex and intricate overall structure, characterized by self-similarity and recursiveness. Ria coastlines, the distribution of animal blood vessels, the shape of tree branches, the frost growing on windows, and the form of mountain ranges are all fractals, and many other structures in the natural world can be understood in the same way.

Concept of fractal
Concept of fractal

Flat fractal tree implementation

Based on the concept above, I implemented a simple 2D fractal tree using ghPython. The _divide_target_branch function below creates the sub-branches of the target branch based on SUB_BRANCH_RATIO and ANGLE. See this link for the full code.


    def _divide_target_branch(self, target_branch):
        """generate target branch's sub branches"""

        target_branch_last_vertex = target_branch.PointAt(1)
        
        reduced_target_branch = rg.Line(
                                    target_branch_last_vertex,
                                    target_branch.PointAt(1 - SUB_BRANCH_RATIO)
                                    )
        
        rotated_reduced_target_branch_1 = gh.Rotate(
                                                reduced_target_branch, 
                                                ANGLE * math.pi, 
                                                gh.XZPlane(target_branch_last_vertex)
                                                ).geometry
        
        rotated_reduced_target_branch_2 = gh.Rotate(
                                                reduced_target_branch, 
                                                (ANGLE + (1 - ANGLE) * 2) * math.pi, 
                                                gh.XZPlane(target_branch_last_vertex)
                                                ).geometry
        
        return rotated_reduced_target_branch_1, rotated_reduced_target_branch_2

Fractal christmas tree馃巹

This is a Christmas tree created by extending the concept of a 2D fractal tree into three dimensions. The image below links to the detailed code. Happy New Year and Merry Christmas!

Fractal christmas tree From the left, self-similarity module 路 top 路 front 路 parallel
Fractal christmas tree
From the left, self-similarity module 路 top 路 front 路 parallel