Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 445201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T21:20:48+00:00 2026-05-12T21:20:48+00:00

I exported a .bin file from RealFlow 4 and now need to be able

  • 0

I exported a .bin file from RealFlow 4 and now need to be able to read it in Python, to make an importer. How do these files work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T21:20:48+00:00Added an answer on May 12, 2026 at 9:20 pm

    Here you go:

    import struct
    
    class Particle:
        """A single particle.  Attributes added in BinFile."""
        pass
    
    class BinFile:
        """Parse and store the contents of a RealFlow .bin file."""
        def __init__(self, fname):
            self.bindata = open(fname, "rb").read()
            self.off = 0
    
            self.verify = self.peel("=i")[0]
            assert self.verify == 0xfabada
            self.name = self.string(250)
    
            (self.version, self.scale, self.fluid_type, self.simtime, self.frame_number,
             self.fps, self.num_particles, self.radius) = self.peel("=hfifiiif")
            self.pressure = self.peel("=fff")
            self.speed = self.peel("=fff")
            self.temperature = self.peel("=fff")
            if self.version >= 7:
                self.emitter_position = self.peel("=fff")
                self.emitter_rotation = self.peel("=fff")
                self.emitter_scale = self.peel("=fff")
    
            self.particles = [self.peel_particle() for i in range(self.num_particles)]
    
        def peel_particle(self):
            """Read one particle from the file."""
            p = Particle()
            p.position = self.peel("=fff")
            p.velocity = self.peel("=fff")
            p.force = self.peel("=fff")
            if self.version >= 9:
                p.vorticity = self.peel("=fff")
            if self.version >= 3:
                p.normal = self.peel("=fff")
            if self.version >= 4:
                p.neighbors = self.peel("=i")[0]
            if self.version >= 5:
                p.texture = self.peel("=fff")
                p.infobits = self.peel("=h")[0]
            (p.age, p.isolation_time, p.viscosity, p.density, p.pressure, p.mass,
             p.temperature, p.id) = self.peel("=fffffffi")
            print p.id, p.neighbors, p.position
            return p
    
        def peel(self, fmt):
            """Read some struct data from `self.bindata`."""
            data = struct.unpack_from(fmt, self.bindata, self.off)
            self.off += struct.calcsize(fmt)
            return data
    
        def string(self, length):
            s = self.bindata[self.off:self.off+length].split("\0")[0]
            self.off += length
            return s
    
    b = BinFile("Circle0100001.bin")
    print "Name:", b.name
    print "Particles:", b.num_particles
    print "Position of first particle", b.particles[0].position
    

    When run on your sample data, it prints:

    Name: Circle01
    Particles: 1066
    Position of first particle (-1.7062506675720215, 4.9283280372619629, -6.4365010261535645)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to make exported .XLS file Editable Thid code makes .XLS File Read Only
I have csv file exported from access. (dates formatted to match mysql) I need
#!/usr/bin/perl while (true) { #Obj: open dir, get flat-file which was exported from bteq
I have a XAML file that I exported from Expression Design. I would like
I have an SQLite database file exported from Scraperwiki with .sqlite file extension. How
I exported a flash web gallery from Lightroom. It uses an XML file to
I exported some data from my database table into sql file as insert statements.
I exported a jar file from Springsource Tools Suite, and when I tried executing
While I try to set java path on ~./bashrc file i exported like: PATH=/usr/local/jdk1.6.0/bin
I have exported datatable to Excel successfully. Now I have to change some cell

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.