<pca006132>
wow, the list of gotchas makes me nervous about my code
<kintel>
Anyway, the default is =off. Not sure why the default was something different in our case
califax has quit [Remote host closed the connection]
kintel has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
califax has joined #openscad
califax has quit [Remote host closed the connection]
califax has joined #openscad
califax has quit [Remote host closed the connection]
califax has joined #openscad
kintel has joined #openscad
snakedGT has quit [Quit: Leaving]
kintel has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ToAruShiroiNeko has quit [Ping timeout: 272 seconds]
hyperair has quit [Ping timeout: 272 seconds]
ToAruShiroiNeko has joined #openscad
hyperair has joined #openscad
J24k62 has quit [Quit: Client closed]
J24k62 has joined #openscad
hyperair has quit [Ping timeout: 272 seconds]
<linext>
is it possible to embed openscad into the .stl file?
<InPhase>
No. Binary stl offers only a very tiny header space, and I don't think there are any accepted formats for comments in the ascii stl files.
J24k62 has quit [Quit: Client closed]
J24k62 has joined #openscad
<InPhase>
linext: Now if you wanted to get clever, you could probably steganographically encode the scad file in the less significant bits of the normal in the binary stl file, and nothing processing the stl file would care about the tiny errors introduced by this. I think the ratios between stl size and typical scad file size are usually good enough that this would fit. But that's super hacky. :)
<InPhase>
linext: To file under the "Yes, but probably don't" category. :)
<J24k62>
and with 3mf you can use a format that support this already and is not from 1980
hyperair has joined #openscad
<Scopeuk>
hmm 2015, newer than I expected
<pca006132>
I strongly recommend against using stl...
<Scopeuk>
it's lowest common denominator, and that alone makes it "just work" in many cases, there are technically better solutions but few as universally supported.
<linext>
what about uploading the file to a website, generating a short url, and putting that in the comment field?
<J24k62>
what comment?
<J24k62>
however a file format that needs a cloud .. like the microsoft links in 3mf that are not working - Ü
deaf_fish has joined #openscad
<pca006132>
I think if the goal is 3D printing, 3MF usually works, and even if it doesn't work the user can use a converter
<deaf_fish>
Hello, I think it would be cool to be able to use models created in openscad in game development. I would like to see the ability to export colors (maybe even UV coords) and simplify the mesh. I am willing to contribute to the project to make that happen. Is there a group working on such a feature set? Where would be a good place to start?
<J24k62>
colors would be nice .. there was some shader for GSoC
<J24k62>
but for games you need mapping which is not part of scad
drfff has joined #openscad
<deaf_fish>
Do you think that adding mapping to scad would be welcomed by the community. Or is this idea of mine not in alignment with the current openscad development roadmap?
<deaf_fish>
Aka, I don't want to add a feature that no one wants. I am fine with friendly forking if that is necessary, but if it isn't, I would rather contribute to the current project.
<J24k62>
but you can import the files in blender generate UV and mapping export as obj and import in unity or make your game with blender4web
<deaf_fish>
I know, that is an option, but I would like to do the model and texturing all with code and something I could put though a make script to generate.
<J24k62>
I think exporting the colors to 3mf would be welcome as multimaterial prints are more common
<deaf_fish>
I have to google what 3mf is.
<deaf_fish>
oh nice
<J24k62>
mapping would require some completely new features and also the handling of images - which is all not part of the script.
<deaf_fish>
I wonder if the material color of the volume needs to be known, not just the surface for 3mf.
<J24k62>
I could imagine a module that lets you import an image .. wait didn't @jordanbrown made something like that already
<deaf_fish>
Would there be push back to adding image support to the script? Also, I am not sure what this will look like in the end. Maybe the idea of an image is not necessary.
<deaf_fish>
I had the idea of modeling everything using just color. Then somehow indicating that this geometry should be projected onto a face instead of rendered as a mesh. That way textures could be generated inside of scad without needing to specify images.
<J24k62>
UV mapping would need orientation so for complex shapes this needs too many parameters to be usefull
<J24k62>
as said colors are already there so we just need to keep them to be included into the rendered data and exported as surface triangle colors
<deaf_fish>
> UV mapping would need orientation
<deaf_fish>
I am not sure this is true. I have created a tool that makes a mesh from SDFs that creates a normal texture. Seems to work mostly ok: https://gitlab.com/hansonry/sdf-modeler
<deaf_fish>
> as said colors are already there so we just need to keep them to be included into the rendered data and exported as surface triangle colors
<deaf_fish>
Yes, this is possible, or you can take the UVs of a face and put them all on a single pixel and then export a pallet image that is just one pixel per color.
<deaf_fish>
That way you don't have to do smart UV mapping calculations.
<J24k62>
if you need to place an image on the UV mapping you need to wrap this which is a process that need adjustments
<pca006132>
manifold does support color, partially
<pca006132>
but there is still quite some work to enable it in openscad
<deaf_fish>
pca006132 what does manifold in this context mean?
<J24k62>
quite strange maybe someone from dev could explain
<linext>
works now on the newest version
L29Ah has left #openscad [#openscad]
<linext>
embed openscad code in .3MF would be a nice advanced option
<InPhase>
deaf_fish: So the key for proper color in OpenSCAD is figuring out how to propagate color through rendering steps.
<InPhase>
deaf_fish: Oh, yes, I missed the part where pca006132 already mentioned Manifold, which is the place where this needs to happen.
<InPhase>
deaf_fish: Note that "color" and "multi-material" are going to be things OpenSCAD is going to want going together on this, but they are easy to see as two versions of the same thing.
<deaf_fish>
Thanks. I was also getting the vibe that CGAL would not easily support separation on color or any other "volume" parameters
<InPhase>
deaf_fish: Like you could imagine telling your slicer "Blue is flexible material, and red is solid material", or something like that.
<pca006132>
they can be different, if you want texture mapping
<InPhase>
deaf_fish: Although we would probably want these annotations riding along in output files like 3mf. This is likely something that can be added in after the core is in place, as long as no design decisions block this from happening, which is why I mention it up front.
<J24k62>
color printing is only using the surface while material needs "parts" to use on
<deaf_fish>
@pca006132 I just see a golden shape, what am I missing?
<InPhase>
deaf_fish: Manifold is so much faster than CGAL that it's probably just a matter of time until we phase CGAL out of the project. We just need to make sure everything is working and stable in Manifold. The closer interaction with the Manifold development team is facilitating the rapid progress on this.
<deaf_fish>
InPhase Good to know
<pca006132>
there should be an animation
<InPhase>
deaf_fish: So this is definitely the place to focus on getting that support. I see no need to try to backport it into the other approaches.
mmu_man has quit [Ping timeout: 255 seconds]
<pca006132>
true, material needs the actual solid, but I feel like this is an easier problem comparing with texture mapping
<deaf_fish>
pca006132 for some reason the link gave me the wrong outcome the first time. Second time, it worked.
<pca006132>
maybe some cache issue
<deaf_fish>
I don't know how one would define internal volumes of a shape.
<InPhase>
J24k62: I think a slicer can guess at portions of a volume to make out of each material based on the surface patterns it receives. Although certainly volumetric descriptions would be cleaner for this.
<deaf_fish>
Would that be separate manifolds?
<pca006132>
I think we can just manipulate the csg tree
<InPhase>
J24k62: This is going to be needed for printing with any sort of color support anyway, since color switching means "use a different filament for some portion".
<pca006132>
and evaluate the thing multiple times
<pca006132>
just make sure positive parts are only using the target material, and the negative parts can use all materials
<pca006132>
no need for vertex properties etc.
<deaf_fish>
pca006132 I'm not quite following you. Say you had a union of two cubes, how could you set things like UVs while doing this?
<J24k62>
InPhase if you want red and green PLA than it is fine to print only surface in that color, but if you want a part that is blue↦ TPU than that surface approach would be bad - not sure how slicer handle this, maybe they understand that if all surface of a volume is the same color then the hole volume is printed with that
<InPhase>
J24k62: Well I'd imagine you just take a shrink-wrap approach with some minimum depth or something.
<J24k62>
so lets say a blue cube and an intersecting red cube - what color is used for the inside /infill
<J24k62>
in BamboStudio e.g. you can just paint the surface for different colors
<InPhase>
J24k62: One simple algorithm is to make all volume elements the color of the nearest surface.
<InPhase>
J24k62: I think that yields mostly right answers matching intention.
<InPhase>
J24k62: And it's consistent enough that you could plan around it.
mmu_man has joined #openscad
<J24k62>
should work. However exporting multi part geometry is another aspect to consider when doing that color export
<pca006132>
well, I think minkowski based rounding is another huge issue...
<InPhase>
J24k62: It also has nice consequent properties, like if you put some colored letters on a surface, the colored filament will actually penetrate slightly into the material as a volume element, which will reduce fracture lines.
<pca006132>
how would you define the material for the minkowski sum of different things?
<pca006132>
a blend?
<pca006132>
deaf_fish: I think for the union case we just ignore the overlapping part? not entirely sure about that
<pca006132>
manifold does not yet have a way of doing UV mapping, we do have some lower level vertex properties that can do linear interpolation, and things for tracking faces etc.
<J24k62>
so one thing is triangle color which the slicer need to interpret and the other is exporting a separate volume
<deaf_fish>
Yeah, which I think is ok.
<deaf_fish>
I don't think manifold should support UVs, but it does look like it gives the tools needed to figure that stuff out.
<pca006132>
yeah there is a discussion about this, and the goal is to provide the tools users need
<J24k62>
afaik if you use game engines you need objects to apply a material getting different materials on one object is a bit tricky
teepee_ has joined #openscad
<J24k62>
you can color surfaces in openscad by using differences/intersections with a colored object
<J24k62>
the question is what a union of a red cube and a blue sphere would become - two parts or one part with colored triangles
teepee has quit [Ping timeout: 255 seconds]
teepee_ is now known as teepee
<J24k62>
So i think we need color() and part()
<pca006132>
I think two parts make more sense
<deaf_fish>
From the game dev perspective I see it as needing to be exported as 1 part with UV map.
<pca006132>
ah and another issue is what to do with intersection
<deaf_fish>
I see nothing wrong with starting with color. The UV map can be dumb. One pixel per color and just smoosh all the UVs into a single pixel of a specific color.
<J24k62>
if you make a wheel you need to tell the gameengine rubber and metal that is not working via UV maps afaik
<deaf_fish>
> ah and another issue is what to do with intersection
<deaf_fish>
I don't know if it is possible, but you could have a "coloring" shape that acts like a volume brush. It doesn't add or remove volume, but sets material information about the volume it crosses.
<pca006132>
this is fine, at least I don't see any issue combining with the approach I said
<deaf_fish>
If you carve a sphere out of a cube, I like the idea of the spheres cut out being the spheres color.
<J24k62>
if openscad should give you a usable obj you would need all the material properties like reflection and glossy that is set in the game engine material
<pca006132>
maybe we can say intersection is only well defined for objects of the same material (or NULL material)
<deaf_fish>
J24k62 Totally! I think once we figure out color, the other stuff should be pretty strait forward.
<deaf_fish>
pca006132 Why that limitation? What are you concerned about?
<deaf_fish>
I am curious
<J24k62>
if you model a car you need to animate the wheels ↦ means you need a multi part object
<pca006132>
deaf_fish: what would be the material if you intersect a metal ball with a wooden ball (of the same size and same center)?
<deaf_fish>
pca006132 Ahh, I get it. From a UV perspective, the solution is easy, but for a volume material perspective, the solution is very hard.
<deaf_fish>
That is a hard question
<J24k62>
first object wins?
<deaf_fish>
J24k62 For my own selfish needs, if I were to model a car. I would make two scad scripts, one for the wheel and one for the car body. I would "assemble" the car in a Game Engine or game code.
<J24k62>
deaf_fish with lazy union you already can export a 3mf that holds the body and 4 separate wheels
<pca006132>
J24k62: my view is that this is *undefined behavior*, so we can either warn the user or arbitrarily set a material (first object wins is one way)
<deaf_fish>
Maybe ignore the cutter material... But then how to store that information for UVs
<deaf_fish>
Maybe it needs to be defined up front if you want UV materials or volume materials.
<deaf_fish>
Or the volume is set by the material used by most of the faces.
<deaf_fish>
If we did that we would want some kind of warning on export or something like that.
<deaf_fish>
If all the faces didn't have the same material so we guessed.
<linext>
is the github page the right place to make a feature request?
<pca006132>
yes
<J24k62>
linext when you open a new issue you can choose feature request
<deaf_fish>
Maybe this discussion is better had on Github.
<linext>
i just want to ask if .3MF files can include the OpenSCAD used to generate them
<InPhase>
J24k62: part() is a complicated thing because of the normal overlap issues. I want other materials that are strictly attached.
<InPhase>
J24k62: Although it certainly does offer the opportunity for more nuanced options. Just we're left with the ambiguity of what to do when they intersect.
<J24k62>
InPhase if you print a multi part object you don't want overlap as the slicer can't handle them well
<deaf_fish>
InPhase How does 3MF deal with volumes of different material? I think that is what we should strive to meet.
<InPhase>
J24k62: The whole idea of multi-material is to have flexible attached to solid and spliced throughout.
<InPhase>
J24k62: To get "smart material" properties out of printed objects.
<deaf_fish>
InPhase I have no idea, but the current "best" practice could be to have separate geometry for each volume material.
<J24k62>
InPhase yes by using inlays that touch but not intersect
<J24k62>
like the opposite of the overlap design rule in scad
<InPhase>
J24k62: But I don't want them printing with gaps. I want them connected. :)
<InPhase>
J24k62: Yes, but this is kind of some hackery that depends on print settings. It would be better to have a cleaner way to express connectedness than counting on nozzle width.
<othx>
J24k62 linked to YouTube video "Cura 4.8 Slicer Tips for Eliminating Gaps in your 3D Prints" => 1 IRC mentions
<J24k62>
InPhase the thing is if you print a part that has overlap the slicer will over extrude in those areas . as far as this is 0.01 it is ok. And with lazy union you can export overlaping parts .. you just should not have large volumes overlapping
<J24k62>
I mean there are printer that can print material gradients - not sure how that is instructed
<deaf_fish>
J24k62 I never thought about that, yeah, you might be able to mix two materials in the future like we can mix colors of pixels today in 2d images.
<J24k62>
industrial printer can color surface by mixing color on the surface like inkjet and other can mix materials too
<J24k62>
there are also consumer printer with mixing nozzles
<J24k62>
i have a demo object with 10 flexible "finger" that have different hardness - i think that was also a resin print system
<Scopeuk>
mimaki origiaonlly made uv cured inkjet conventional printers, then realised they could just layer it up to do full colour 3d. never seen any of it in person, we frequent differnt events
<J24k62>
on the euro mold expo they have all these fancy systems - also powder bed printer that are colored with a inkjet head each layer - but these are all in the 50k+ range
<J24k62>
but you get the "brass diamond extruder" which allows mixing 3 filaments