Jump to page: 1 2 3
Thread overview
WildCAD - a simple 2D drawing application
Jan 26
Dadoum
5 days ago
Johann Lermer
5 days ago
Adam D Ruppe
2 days ago
Johann Lermer
1 day ago
Adam D Ruppe
1 day ago
Johann Lermer
6 days ago
Johann Lermer
6 days ago
Adam D Ruppe
6 days ago
Johann Lermer
6 days ago
Adam D Ruppe
6 days ago
bachmeier
5 days ago
bachmeier
4 days ago
bachmeier
4 days ago
WebFreak001
3 days ago
Hipreme
5 days ago
H. S. Teoh
5 days ago
H. S. Teoh
6 days ago
Johann Lermer
Jan 28
Ulrich
January 25

Hi,

I'd like to announce a little project of mine that started some years ago as a C++ application and which I finally managed to port to D. It's called WildCAD and it's a simple 2D drawing program (you know - lines, circles and so on). It uses a command line interface inspired by AutoCAD and features a very immature DXF im- and export.

The application uses a DIY widget set (which comes as a sub project) called WildWidgets. Both can be found at https://gitlab.com/elvin.eu/wildcad.git and https://gitlab.com/elvin.eu/wildwidgets.git

Currently both are restricted to DMD and Linux/X11 only. Sorry for that. On the plus side just very limited dependencies are needed - mostly X11, Cairo and Cups. It's still very rough and using it can be a bit of a challenge.

Any feedback or help is appreciated ;-)

January 26

On Wednesday, 25 January 2023 at 14:36:54 UTC, Johann Lermer wrote:

>

Hi,

I'd like to announce a little project of mine that started some years ago as a C++ application and which I finally managed to port to D. It's called WildCAD and it's a simple 2D drawing program (you know - lines, circles and so on). It uses a command line interface inspired by AutoCAD and features a very immature DXF im- and export.

The application uses a DIY widget set (which comes as a sub project) called WildWidgets. Both can be found at https://gitlab.com/elvin.eu/wildcad.git and https://gitlab.com/elvin.eu/wildwidgets.git

Currently both are restricted to DMD and Linux/X11 only. Sorry for that. On the plus side just very limited dependencies are needed - mostly X11, Cairo and Cups. It's still very rough and using it can be a bit of a challenge.

Any feedback or help is appreciated ;-)

Hello, cool work.

Just a small tip: add screenshots in your readmes. It will make people more interested because when there are none, usually people will not take the time to fetch the project to check it out.

January 26
I briefly played around with it, not bad at all. I did see the menus popped up in the wrong place though, something to note is that ConfigureNotify is a bit complicated in how it works. Let me copy/paste a comment from my simpledisplay.d:

/+
        The ICCCM says window managers must send a synthetic event when the window
        is moved but NOT when it is resized. In the resize case, an event is sent
        with position (0, 0) which can be wrong and break the dpi calculations.

        So we only consider the synthetic events from the WM and otherwise
        need to wait for some other event to get the position which... sucks.
+/
if(event.send_event) {
        win.screenPositionKnown = true;
        win.screenPositionX = event.x;
        win.screenPositionY = event.y;
}



You can also request the window position with XTranslateCoordinates:

int x, y;
Window dummyw;
XTranslateCoordinates(dpy, window.nativeHandle, RootWindow(dpy, DefaultScreen(dpy)), x, y, &x, &y, &dummyw);



Which is what I do when it is time to pop up a menu.


Your thing works ok when maximized tho, it is kinda nice how you got the rest working.

But as a fellow DIY widgetset author it is always fun to compare and contrast :)

And since some of these X things are a bit obscure it helps to steal tips from each other lol
January 26

On Wednesday, 25 January 2023 at 14:36:54 UTC, Johann Lermer wrote:

>

Hi,

I'd like to announce a little project of mine that started some years ago as a C++ application and which I finally managed to port to D. It's called WildCAD and it's a simple 2D drawing program (you know - lines, circles and so on). It uses a command line interface inspired by AutoCAD and features a very immature DXF im- and export.

The application uses a DIY widget set (which comes as a sub project) called WildWidgets. Both can be found at https://gitlab.com/elvin.eu/wildcad.git and https://gitlab.com/elvin.eu/wildwidgets.git

Currently both are restricted to DMD and Linux/X11 only. Sorry for that. On the plus side just very limited dependencies are needed - mostly X11, Cairo and Cups. It's still very rough and using it can be a bit of a challenge.

Any feedback or help is appreciated ;-)

this reminded me of KediCAD[1]. The author used the Gambas programming language. A long time ago, I chatted with the author, and he was thinking of an alternative language for development. I knew nothing about d at that time. I have just noticed that the author closed the source, or I failed to find it. I think D has great potential for creating CAD software. I will give it a try, but I wish it would use dub as a build system.

1: https://sourceforge.net/projects/parduscad/

January 27
On Thursday, 26 January 2023 at 14:31:55 UTC, Adam D Ruppe wrote:

> I briefly played around with it, not bad at all. I did see the menus popped up in the wrong place though, something to note is that ConfigureNotify is a bit complicated in how it works. Let me copy/paste a comment from my simpledisplay.d:

True, although here it works. But X11 is a beast and sometimes I loose the fight.

> You can also request the window position with XTranslateCoordinates:

I'll try that, thanks.

> And since some of these X things are a bit obscure

no one ever spoke a truer word :-))



January 27

On Thursday, 26 January 2023 at 13:23:46 UTC, Dadoum wrote:

>

Just a small tip: add screenshots in your readmes.

Good idea. I'll do that.

January 28

On Wednesday, 25 January 2023 at 14:36:54 UTC, Johann Lermer wrote:

>

Hi,

I'd like to announce a little project of mine that started some years ago as a C++ application and which I finally managed to port to D. It's called WildCAD and it's a simple 2D drawing program (you know - lines, circles and so on). It uses a command line interface inspired by AutoCAD and features a very immature DXF im- and export.

[...]

Very very sweet. Works like a charm. It is the simple things that bring joy and happiness. Great work!

6 days ago

On Thursday, 26 January 2023 at 14:48:17 UTC, Ferhat Kurtulmuş wrote:

>

I will give it a try, but I wish it would use dub as a build system.

Well, I tried dub and wasn't convinced - maybe due to a lack of documentation but I couldn't get it running the way I wanted (that is, with my directory structure and having wildwidgets as a subproject). So I decided, that I'll stick with what I know and that is good old make ;-)

But maybe someday someone can do something about it?

6 days ago
dub isn't the issue, people who fight it like this, fight the D compilers and end up having issues.

You're fundamentally doing something that D compilers are not designed to handle. The problem is with -I flag. Being able to set a directory to look modules up in.

Problem is it needs to match the packages to directories.

I.e.

wildwidgets/lib/source/wcw/clipboard.d

Not:

wildwidgets/lib/source/clipboard.d

Also note: you should not use symlinks with VCS, there are cross-platform problems with it.
6 days ago
On Sunday, 29 January 2023 at 13:55:41 UTC, Richard (Rikki) Andrew Cattermole wrote:
> dub isn't the issue, people who fight it like this, fight the D compilers and end up having issues.

dub fights D compilers. This is why it forces me to write 600 lines of ugly configuration file for something that just works in dmd.


That said, the directory layout here is indeed not optimal, and the makefile build takes *forever* which is disturbing. This program should probably build in < 3 seconds, not the... minute or two it took running make here.

Proof:

$ time dmd -i wildcad.d -I../../widgets/lib/source/ -I../../widgets/include -version=X11 -L-lX11 -L-lcups -L-lfontconfig -L-lcairo

real    0m2.703s

Fully operational executable created in under 3 seconds.
« First   ‹ Prev
1 2 3