Hi!
What do you think of breaking OpenSCAD source into three parts, namely
Model, View and Controller as per Wikipedia article:
https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller
https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller ?
I can see some immediate advantages :
Off course there will be some disadvantages as well:
8. The code will be in limbo for a long time when some of the code is well
structured and some is as the old structure.
9. It takes time to break up code that may have several responsibilities
now.
10. It is boring to rewrite something that just works.
11. Your disadvantages...
//Best regards Henrik
--
Sent from: http://forum.openscad.org/
MVC is mainly a UI paradigm and OpenSCAD does largely follow this with a few exceptions; e.g. there is view logic in the PolySet class, the controller is very heavy, there isn't 100% separation between pure model (AST) and operations on the model etc.
I believe all of this can be refactored piece by piece; the main challenge will be testing that the result is correct, as we don't have any automated UI testing.
In short: Worth trying, but perhaps think about a testing strategy first.
-Marius
I would be thrilled to have more control of things in the controller /
customizer angle.
In particular, direct support for units, so that a user could plug in a
dimension with units and have the display update to an object of that size
along with textual displays of the current dimensions, then if the units
displayed are changed, the displayed numbers are recalculated so as to
display the dimensions for the current object in the selected units.
William
On Mon, Mar 11, 2019 at 11:49 AM Marius Kintel marius@kintel.net wrote:
MVC is mainly a UI paradigm and OpenSCAD does largely follow this with a
few exceptions; e.g. there is view logic in the PolySet class, the
controller is very heavy, there isn't 100% separation between pure model
(AST) and operations on the model etc.
I believe all of this can be refactored piece by piece; the main challenge
will be testing that the result is correct, as we don't have any automated
UI testing.
In short: Worth trying, but perhaps think about a testing strategy first.
-Marius
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
William Adams-2 wrote
I would be thrilled to have more control of things in the controller /
customizer angle.
In particular, direct support for units, so that a user could plug in a
dimension with units and have the display update to an object of that size
along with textual displays of the current dimensions, then if the units
displayed are changed, the displayed numbers are recalculated so as to
display the dimensions for the current object in the selected units.
William
That is really exiting and doable for many OpenSCAD models. I think of an
example
that may not display correctly though: if you have drawn a shape of a heart
with
exact radii and scale the object by entering new units, the radii may not
follow the
change in dimension as expected; thus if the appearance of the object is
good
enough - then fine; but if the exact radii is needed, then you may have to
try and test
a few times to get the right size.
On Mon, Mar 11, 2019 at 11:49 AM Marius Kintel <
marius@
> wrote:
MVC is mainly a UI paradigm and OpenSCAD does largely follow this with a
few exceptions; e.g. there is view logic in the PolySet class, the
controller is very heavy, there isn't 100% separation between pure model
(AST) and operations on the model etc.
I believe all of this can be refactored piece by piece; the main
challenge
will be testing that the result is correct, as we don't have any
automated
UI testing.
In short: Worth trying, but perhaps think about a testing strategy first.
-Marius
Good that OpenSCAD seems to follow the paradigm (it is there but not
explicit with
controller in class names etc). All right... didn't think of the automated
UI testing.
Well a folder structure could at least make it easier to find the right
files for newcomers
so my suggestion with the paradigm could just be to set up a structure of
folders in
,for example, three levels for all files in src.
//Henrik
--
Sent from: http://forum.openscad.org/
Is it possible to control the application window size and placement of
OpenCAD when it's launched?
Or to turn on/off various interface options such as the text editor and
customizer?
On Tue, Mar 12, 2019 at 3:42 PM grit henwist@gmail.com wrote:
William Adams-2 wrote
I would be thrilled to have more control of things in the controller /
customizer angle.
In particular, direct support for units, so that a user could plug in a
dimension with units and have the display update to an object of that
size
along with textual displays of the current dimensions, then if the units
displayed are changed, the displayed numbers are recalculated so as to
display the dimensions for the current object in the selected units.
William
That is really exiting and doable for many OpenSCAD models. I think of an
example
that may not display correctly though: if you have drawn a shape of a heart
with
exact radii and scale the object by entering new units, the radii may not
follow the
change in dimension as expected; thus if the appearance of the object is
good
enough - then fine; but if the exact radii is needed, then you may have to
try and test
a few times to get the right size.
On Mon, Mar 11, 2019 at 11:49 AM Marius Kintel <
marius@
> wrote:
MVC is mainly a UI paradigm and OpenSCAD does largely follow this with a
few exceptions; e.g. there is view logic in the PolySet class, the
controller is very heavy, there isn't 100% separation between pure model
(AST) and operations on the model etc.
I believe all of this can be refactored piece by piece; the main
challenge
will be testing that the result is correct, as we don't have any
automated
UI testing.
In short: Worth trying, but perhaps think about a testing strategy
first.
-Marius
Good that OpenSCAD seems to follow the paradigm (it is there but not
explicit with
controller in class names etc). All right... didn't think of the automated
UI testing.
Well a folder structure could at least make it easier to find the right
files for newcomers
so my suggestion with the paradigm could just be to set up a structure of
folders in
,for example, three levels for all files in src.
//Henrik
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
William Adams-2 wrote
Is it possible to control the application window size and placement of
OpenCAD when it's launched?
Or to turn on/off various interface options such as the text editor and
customizer?
ATM* on Windows all that is in the registry, the same will be somewhere on
other platforms.
*-there is an issue proposing to move it to n .ini file.
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\OpenSCAD]
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD]
"recentFileList"=hex(7):43,00EDIT...
"lastOpenDirName"="C:/Users/EDIT...
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\3dview]
"colorscheme"="Cornfield"
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\advanced]
"openCSGLimit"="1000000000"
"undockableWindows"="true"
"mdi"="true"
"enable_opencsg_opengl1x"="true"
"cgalCacheSize"="2147483647"
"polysetCacheSize"="2147483647"
"reorderWindows"="true"
"forceGoldfeather"="true"
"opencsg_show_warning"="false"
"enableSoundNotification"="true"
"localization"="true"
"enableParameterCheck"="false"
"cgalCacheSizeMB"="2047"
"polysetCacheSizeMB"="2047"
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\design]
"autoReload"="false"
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\editor]
"fontsize"=dword:0000000a
"ctrlmousewheelzoom"="false"
"editortype"="QScintilla Editor"
"syntaxhighlight"="Visual Studio"
"fontfamily"="Courier New"
"backspaceUnindents"="true"
"showWhitespacesSize"="9"
"lineWrap"="Char"
"lineWrapVisualizationEnd"="Text"
"indentationWidth"="2"
"tabWidth"="2"
"lineWrapIndentationStyle"="Same"
"lineWrapVisualizationBegin"="Border"
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\feature]
"concat"="true"
"text"="true"
"lc-for-c"="true"
"lc-else"="true"
"lc-each"="true"
"svg-import"="true"
"customizer"="true"
"echo"="true"
"assert"="true"
"amf-import"="true"
"thread-traversal"="true"
"input-driver"="true"
"3mf-import"="true"
"3mf-export"="true"
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\InputDriver]
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\InputDriver\axis]
"translateX"="+1"
"translateY"="-2"
"translateZ"="-3"
"rotateX"="+4"
"rotateY"="-5"
"rotateZ"="-6"
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\InputDriver\button]
"1"="viewActionResetView"
"2"="viewActionViewAll"
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\launcher]
"showOnStartup"="true"
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\view]
"orthogonalProjection"="true"
"showCrosshairs"="false"
"showAxes"="true"
"hideEditor"="false"
"showEdges"="false"
"hideConsole"="false"
"hideToolbar"="false"
"showScaleProportional"="true"
"hideCustomizer"="true"
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\window]
"size"="@Size(1484 1051)"
"position"="@Point(86 2)"
"state"=hex:40,00,42,00,79,00,74,00,65,00,41,00,72,00,72,00,61,00,79,00,28,00,\
00,00,00,00,00,00,ff,00,00,00,00,00,00,00,00,00,fd,00,00,00,00,00,00,00,03,\
00,00,00,00,00,00,00,00,00,00,00,00,00,02,00,a6,00,00,00,00,00,03,00,f2,00,\
fc,00,02,00,00,00,00,00,00,00,01,00,fb,00,00,00,00,00,00,00,14,00,00,00,65,\
00,00,00,64,00,00,00,69,00,00,00,74,00,00,00,6f,00,00,00,72,00,00,00,44,00,\
00,00,6f,00,00,00,63,00,00,00,6b,00,01,00,00,00,00,00,00,00,12,00,00,00,00,\
00,03,00,f2,00,00,00,00,00,00,00,6d,00,00,00,ff,00,ff,00,ff,00,00,00,00,00,\
00,00,01,00,00,00,00,00,01,00,43,00,00,00,00,00,00,00,00,00,fc,00,02,00,00,\
00,00,00,00,00,01,00,fb,00,00,00,00,00,00,00,1a,00,00,00,70,00,00,00,61,00,\
00,00,72,00,00,00,61,00,00,00,6d,00,00,00,65,00,00,00,74,00,00,00,65,00,00,\
00,72,00,00,00,44,00,00,00,6f,00,00,00,63,00,00,00,6b,00,00,00,00,00,00,00,\
00,00,12,00,00,00,00,00,00,00,8a,00,00,00,00,00,00,00,8a,00,00,00,ff,00,ff,\
00,ff,00,00,00,00,00,00,00,03,00,00,00,00,00,03,00,22,00,00,00,00,00,01,00,\
60,00,fc,00,01,00,00,00,00,00,00,00,01,00,fb,00,00,00,00,00,00,00,16,00,00,\
00,63,00,00,00,6f,00,00,00,6e,00,00,00,73,00,00,00,6f,00,00,00,6c,00,00,00,\
65,00,00,00,44,00,00,00,6f,00,00,00,63,00,00,00,6b,00,01,00,00,00,00,00,02,\
00,aa,00,00,00,00,00,03,00,22,00,00,00,00,00,00,00,48,00,00,00,ff,00,ff,00,\
ff,00,00,00,00,00,03,00,22,00,00,00,00,00,02,00,8e,00,00,00,00,00,00,00,01,\
00,00,00,00,00,00,00,02,00,00,00,00,00,00,00,01,00,00,00,00,00,00,00,02,00,
fc,00,00,00,00,00,00,00,00,00,29,00
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\window\splitter1sizes]
"size"=dword:00000002
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\window\splitter1sizes\1]
"entry"=dword:00000188
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\window\splitter1sizes\2]
"entry"=dword:0000018a
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\window\splitter2sizes]
"size"=dword:00000002
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\window\splitter2sizes\1]
"entry"=dword:00000176
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\window\splitter2sizes\2]
"entry"=dword:0000009d
Admin - email* me if you need anything, or if I've done something stupid...
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
Sent from: http://forum.openscad.org/
Oh. Darn. No option to use some options passed in when the application is
started / called?
William
On Wed, Mar 13, 2019 at 5:17 PM MichaelAtOz oz.at.michael@gmail.com wrote:
William Adams-2 wrote
Is it possible to control the application window size and placement of
OpenCAD when it's launched?
Or to turn on/off various interface options such as the text editor and
customizer?
ATM* on Windows all that is in the registry, the same will be somewhere on
other platforms.
*-there is an issue proposing to move it to n .ini file.
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\OpenSCAD]
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD]
"recentFileList"=hex(7):43,00EDIT...
"lastOpenDirName"="C:/Users/EDIT...
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\3dview]
"colorscheme"="Cornfield"
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\advanced]
"openCSGLimit"="1000000000"
"undockableWindows"="true"
"mdi"="true"
"enable_opencsg_opengl1x"="true"
"cgalCacheSize"="2147483647"
"polysetCacheSize"="2147483647"
"reorderWindows"="true"
"forceGoldfeather"="true"
"opencsg_show_warning"="false"
"enableSoundNotification"="true"
"localization"="true"
"enableParameterCheck"="false"
"cgalCacheSizeMB"="2047"
"polysetCacheSizeMB"="2047"
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\design]
"autoReload"="false"
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\editor]
"fontsize"=dword:0000000a
"ctrlmousewheelzoom"="false"
"editortype"="QScintilla Editor"
"syntaxhighlight"="Visual Studio"
"fontfamily"="Courier New"
"backspaceUnindents"="true"
"showWhitespacesSize"="9"
"lineWrap"="Char"
"lineWrapVisualizationEnd"="Text"
"indentationWidth"="2"
"tabWidth"="2"
"lineWrapIndentationStyle"="Same"
"lineWrapVisualizationBegin"="Border"
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\feature]
"concat"="true"
"text"="true"
"lc-for-c"="true"
"lc-else"="true"
"lc-each"="true"
"svg-import"="true"
"customizer"="true"
"echo"="true"
"assert"="true"
"amf-import"="true"
"thread-traversal"="true"
"input-driver"="true"
"3mf-import"="true"
"3mf-export"="true"
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\InputDriver]
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\InputDriver\axis]
"translateX"="+1"
"translateY"="-2"
"translateZ"="-3"
"rotateX"="+4"
"rotateY"="-5"
"rotateZ"="-6"
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\InputDriver\button]
"1"="viewActionResetView"
"2"="viewActionViewAll"
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\launcher]
"showOnStartup"="true"
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\view]
"orthogonalProjection"="true"
"showCrosshairs"="false"
"showAxes"="true"
"hideEditor"="false"
"showEdges"="false"
"hideConsole"="false"
"hideToolbar"="false"
"showScaleProportional"="true"
"hideCustomizer"="true"
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\window]
"size"="@Size(1484 1051)"
"position"="@Point(86 2)"
"state"=hex:40,00,42,00,79,00,74,00,65,00,41,00,72,00,72,00,61,00,79,00,28,00,\
00,00,00,00,00,00,ff,00,00,00,00,00,00,00,00,00,fd,00,00,00,00,00,00,00,03,\
00,00,00,00,00,00,00,00,00,00,00,00,00,02,00,a6,00,00,00,00,00,03,00,f2,00,\
fc,00,02,00,00,00,00,00,00,00,01,00,fb,00,00,00,00,00,00,00,14,00,00,00,65,\
00,00,00,64,00,00,00,69,00,00,00,74,00,00,00,6f,00,00,00,72,00,00,00,44,00,\
00,00,6f,00,00,00,63,00,00,00,6b,00,01,00,00,00,00,00,00,00,12,00,00,00,00,\
00,03,00,f2,00,00,00,00,00,00,00,6d,00,00,00,ff,00,ff,00,ff,00,00,00,00,00,\
00,00,01,00,00,00,00,00,01,00,43,00,00,00,00,00,00,00,00,00,fc,00,02,00,00,\
00,00,00,00,00,01,00,fb,00,00,00,00,00,00,00,1a,00,00,00,70,00,00,00,61,00,\
00,00,72,00,00,00,61,00,00,00,6d,00,00,00,65,00,00,00,74,00,00,00,65,00,00,\
00,72,00,00,00,44,00,00,00,6f,00,00,00,63,00,00,00,6b,00,00,00,00,00,00,00,\
00,00,12,00,00,00,00,00,00,00,8a,00,00,00,00,00,00,00,8a,00,00,00,ff,00,ff,\
00,ff,00,00,00,00,00,00,00,03,00,00,00,00,00,03,00,22,00,00,00,00,00,01,00,\
60,00,fc,00,01,00,00,00,00,00,00,00,01,00,fb,00,00,00,00,00,00,00,16,00,00,\
00,63,00,00,00,6f,00,00,00,6e,00,00,00,73,00,00,00,6f,00,00,00,6c,00,00,00,\
65,00,00,00,44,00,00,00,6f,00,00,00,63,00,00,00,6b,00,01,00,00,00,00,00,02,\
00,aa,00,00,00,00,00,03,00,22,00,00,00,00,00,00,00,48,00,00,00,ff,00,ff,00,\
ff,00,00,00,00,00,03,00,22,00,00,00,00,00,02,00,8e,00,00,00,00,00,00,00,01,\
00,00,00,00,00,00,00,02,00,00,00,00,00,00,00,01,00,00,00,00,00,00,00,02,00,
fc,00,00,00,00,00,00,00,00,00,29,00
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\window\splitter1sizes]
"size"=dword:00000002
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\window\splitter1sizes\1]
"entry"=dword:00000188
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\window\splitter1sizes\2]
"entry"=dword:0000018a
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\window\splitter2sizes]
"size"=dword:00000002
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\window\splitter2sizes\1]
"entry"=dword:00000176
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\window\splitter2sizes\2]
"entry"=dword:0000009d
Admin - email* me if you need anything, or if I've done something stupid...
Unless specifically shown otherwise above, my contribution is in the
Public Domain; to the extent possible under law, I have waived all
copyright and related or neighbouring rights to this work. Obviously
inclusion of works of previous authors is not included in the above.
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
William Adams-2 wrote
Oh. Darn. No option to use some options passed in when the application is
started / called?
No.
If you're on Windows you could modify the Registry in a batch file like so:
https://stackoverflow.com/questions/13809856/run-reg-command-in-cmd-bat-file?noredirect=1&lq=1
(I've not done this myself, yet) [make a backup!]
Admin - email* me if you need anything, or if I've done something stupid...
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
Sent from: http://forum.openscad.org/
That's a bit too risky for distributing an application as a solution.
Wonder if there's some scripting tool which could do this.
William
On Thu, Mar 14, 2019 at 6:05 PM MichaelAtOz oz.at.michael@gmail.com wrote:
William Adams-2 wrote
Oh. Darn. No option to use some options passed in when the application is
started / called?
No.
If you're on Windows you could modify the Registry in a batch file like so:
https://stackoverflow.com/questions/13809856/run-reg-command-in-cmd-bat-file?noredirect=1&lq=1
(I've not done this myself, yet) [make a backup!]
Admin - email* me if you need anything, or if I've done something stupid...
Unless specifically shown otherwise above, my contribution is in the
Public Domain; to the extent possible under law, I have waived all
copyright and related or neighbouring rights to this work. Obviously
inclusion of works of previous authors is not included in the above.
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org