Releases: rs0125/brlcad
Release list
libmcpcad test build with local IPC (BRL-CAD 7.45.0, Linux x86_64)
A test build of the libmcpcad branch, so you can try the MCP interface without
building BRL-CAD first. Linux x86_64.
libmcpcad gives BRL-CAD a local listener, so another program can run geometry
commands against a model you have open. In MGED that is the mcp_listen
command, and the view refreshes as commands come in.
This build adds a Unix-domain socket alongside the loopback port, for machines
where a listening TCP port is not permitted. The protocol is the same on both,
so nothing on the client side changes.
Proposed upstream as PR #253.
Use it
tar xJf brlcad-7.45.0-libmcpcad-ipc-linux-x86_64.tar.xz
cd brlcad-7.45.0-libmcpcad-linux-x86_64
cp /path/to/model.g work.g # it edits the file you give it
./bin/mged work.gThen at the MGED prompt, either a port:
mcp_listen 5555
or a socket:
mcp_listen ipc /tmp/brlcad.sock
mcp_listen ipc # or let it choose, and print, a path
MGED stays usable while it listens. mcp_listen status reports where, and
mcp_listen off stops it and removes the socket file. One listener runs at a
time, so switching transports means mcp_listen off first.
If you have no GUI, or you are on a remote machine, there is a headless listener
instead. Its first argument selects the transport:
./bin/mcpcad_test_server 5555 work.g # a port
./bin/mcpcad_test_server /tmp/brlcad.sock work.g # a socketThe socket path has to be absolute, since anything else is read as a port
number.
Either way, point the agent at it:
brlcad-mcp rc2.
Talking to it directly
Every message, in both directions, is 'M' 'C' followed by a 4-byte big-endian
length and that many bytes of payload. Requests are command text; replies start
with OK\n or ERR <code>\n.
import socket, struct
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
s.connect("/tmp/brlcad.sock")
p = b"in box rpp 0 20 0 20 0 20"
s.sendall(b"MC" + struct.pack(">I", len(p)) + p)
h = s.recv(6)
print(s.recv(struct.unpack(">I", h[2:])[0]).decode())libmcpcad test build (BRL-CAD 7.43.0, Linux x86_64)
A test build of the libmcpcad branch, so you can try the MCP interface without
building BRL-CAD first. Linux x86_64.
libmcpcad gives BRL-CAD a loopback socket, so another program can run geometry
commands against a model you have open. In MGED that is the mcp_listen
command, and the view refreshes as commands come in.
Proposed upstream as PR #238.
Use it
tar xJf BRL-CAD_7.43.0_linux_x86_64_libmcpcad.tar.xz
cd brlcad-7.43.0-libmcpcad
cp /path/to/model.g work.g # it edits the file you give it
./bin/mged work.gThen at the MGED prompt:
mcp_listen 5555
MGED stays usable while it listens. mcp_listen status reports the state and
mcp_listen off stops it.
If you have no GUI, or you are on a remote machine, there is a headless listener
instead:
./bin/mcpcad_test_server 5555 work.gEither way, point the agent at port 5555:
brlcad-mcp rc1.
Notes
- Needs glibc 2.34 or newer, so Ubuntu 22.04+, Fedora 35+, or RHEL 9+.
- The MGED GUI uses X11, fontconfig, freetype, harfbuzz and libXScrnSaver from
your distro. On Fedora,sudo dnf install libXScrnSaver. The headless
listener,rtandnirtdo not need them. - Built with debug symbols, so renders are slower than a release build.
- 7.43.0 is a development version under BRL-CAD's numbering, not a BRL-CAD
release. Those come from BRL-CAD/brlcad.