Giter Club home page Giter Club logo

fcpd's Introduction

FreeCAD/PureData connection framework

FCPD is a set of FreeCAD python macros and Pure-Data (aka PD) patches to link the two software.

This repository is no more maintained, please use FCPDWorkbench.

What is it for ?

FreeCAD is more than a CAD and Pure-Data is more than "a free real-time computer music system". Using a real-time visual programming language to control FreeCAD can results in an orchestrated animation system or a procedural modeling one. Or the reverse, imagine a real-time performance with visual/musical effects controlled by FreeCAD virtual objects.

As you can start to see, imagination and programming skill are one's only limitation when using FCPD.

Sample

Requirements

External libraries are needed for Pure-Data :

  • list-abs
  • iemlib See Pure-Data documentation to install them or use an already populated distribution as Purr-Data.

Installation

Usage

On the FreeCAD side

See Sample/PdAccessObjectProperties.FCMacro for an example

  • Import the pdserver module in your macro
  • instantiate a pdserver.PureDataServer object with address and port to listen to as constructor arguments
  • set the default message handler i.e. function which take the incoming message as argument and return a stringable value to give back to Pure-Data
  • with message handler registration system you can use different function depending of the first word of the incoming message. Simply call PureDataServer.register_message_handler([first_word], function_to_call)
  • run the server with pureDataServer.run()

On Pure-Data side

See Sample/test.pd for an example

  • Use a [declare -path ] object to let Pure-Data know where to find the FCPD objects
  • Add a [fc_client] object with these arguments
    1. Remote IP address of the (remote) computer on which the FreeCAD pdserver is listening
    2. Remote port of the (remote) computer on which the FreeCAD pdserver is listening
    3. Local port on which the remote FreeCAD can callback
    4. '1' for autoconnect (try to connect every second)
  • Communicate with FreeCAD throw [fc_process]

PD objects are documented. Access help via Right mouse button(RMB) > Help

More about messages

Pure-Data messages are text only so the FreeCAD objects have to be converted to and from string to be processed with Pure-Data.

The PureDataServer object automatically remove non-conform characters of the callback message i.e. , and = are converted to space and ';()\[\]{}" are removed. In this way the Base.Vector python object whose string representation is Vector(0.0,0.0,0.0) can be a return value of a message handler and converted to Vector 0.0 0.0 0.0 PD message.

Feedback

Bugs, feature requests, and inquiries ? Please open tickets in the repo's issue queue.

License

Copyright 2020 @flachyjoe and other contributors

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

fcpd's People

Contributors

flachyjoe avatar luzpaz avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

luzpaz dseeni

fcpd's Issues

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.