JSCAD/OPENJSCAD 3D model example - openscad

Is there any simple example of creating 3D model of simple wall of bricks using JSCAD/OPENJSCAD and exporting it as STL file.

Related

How to add 3D model object in 3Doccupancy map?

I have created a 3D occupancy map to model a region where I want to test some path planning algorithms for an autonomous robot. I have created a 3D map along with obstacles, but my requirement is to add 3D model (eg, human,car,tree etc anything) to my map.
The example is difficult to understand. Can somebody help me in adding some model.
Note: I have made these buildings but i want to add some sort of models (like humans, tree,car etc)
Also can we add png,or gif to our map?
GIF of a Car
My 3D map
I have created a 3D map along with obstacles, but my requirement is to add 3D model (eg, human,car,tree etc anything) to my map.

How to save modified mesh at runtime?

In my game, I modify mesh at runtime using a damage algorithm.
After that, I would like to save them.
I get all meshes with:
MeshFilter[] meshfilters = MyObject.GetComponentsInChildren<MeshFilter>();
then i modify single mesh.
How to save that in my original FBX file ?
Thanks
Unity's internal mesh type is not the same as an FBX, FBX is a file storage format, while Unity uses a different internal structure at runtime, for greater efficiency.
As far as I know there is no standard way to save out a runtime mesh as an FBX (this is a feature of 3D modelling software, not a game engine)
You can save your deformations somehow and re-apply them when you reload the model, when I did a similar thing (custom generated terrain meshes at runtime) I would generate a mesh at runtime, then save the data required to generate that mesh, then pass it into the same flow I used to generate the mesh in the first place.
It is possible to serialise meshdata in the unity editor as meshdata is actually a different format from FBX (Unity reads an FBX, then generates a mesh asset from the FBX's data, then associates that mesh with the FBX) You do this by playing with AssetDatabase.CreateAsset() https://docs.unity3d.com/ScriptReference/AssetDatabase.CreateAsset.html
But I don't think this is what you're intending to do.
If you want the full FBX suite of features (skinning, animation, use in other unity projects) and you want them at runtime, you don't really have any options that I know of. Short of implementing your own FBX serialisation library (not really a reasonable solution)

Import 3D model to Xcode with its nodes

I have 3D Models which have many parts and are designed by some 3D editors such as: AutoCad, Blender...
Those 3D Models are combined many parts, so I want to import them to Xcode with same parts, then add Node to each part.
I want to interact with each part in ScenceView.
3D model from:
https://drive.google.com/file/d/11MccUtXd61wDWQldMTleotvg_yoHnzWP/view?usp=sharing
As i can see on the link provided by you, the 3D model is available in FBX and OBJ formate. for using in Xcode you can try using following steps.
Convert your model into DAE or .SCN formate. (you can use Blender) .DAE and .SCN formate contains all the nodes in a single file.
import your Model with associate texture folder in the art.scnassets folder.
Load and use your model.

Flatten 3D object to create a template for a 2D texture map

I would like to create a texture map for a 3D car model I have. I am not sure where to start. I thought maybe I could unwrap the 3D object to a 2D image and then use this as an outline to draw my texture. Is this possible, or is there a simpler solution?
Thank you in advance!
I would like to create a texture map for a 3D car model I have. I am not sure where to start
What you are asking about is called UV mapping.
"UV mapping is the 3D modeling process of projecting a 2D image to a 3D model's surface for texture mapping."
Source: https://en.wikipedia.org/wiki/UV_mapping
UV mapping is normally done when creating the model in 3d modelling software, although there may be assets in Unity able to do the same. To my knowledge Unity is not able to directly UV map.
You can however, change the texture of an object inside Unity as well as assign objects various colours and materials.
maybe I could unwrap the 3D object to a 2D image and then use this as an outline to draw my texture
To my knowledge you need 3d modelling software to do so, but yes, it is possible.
You can try to change it through scripting, but I'd recommend looking into 3d modelling software instead as I believe that if it is possible it will be bothersome.
3D modelling software I know of:
Blender - Free
Maya - Licensed
3DS Max - Licensed

Put a Cinema 4D model and Texture into an iPhone App

Im an iPhone developer and i'm trying to get a 3D model that I create in Cinema 4D into an app im making. I have actually found a way to get the model in (by exporting it as a .dae or obj and using a python script) which works really well however I can't get the textures to come with it. My script actually can only handle 1 texture as well.
Basically I need to ether create and export a UV map in c4d (but I have no idea how to do this) or I figure out a way to read multiple textures into my Open Gl - ES app with a script or PowerVR. (this is probably better)
Sorry for the noob questions but im very new at the 3D world.
Cheers
I would recommend that you use Blender. Export your Cinema-4D model for Blender and use Blender to create UVMaps.
You need to make seams and unwrap the model. After that save a targa template for your texture, apply your texture on that targa. Save it as png or jpg. Apply that texture image to your model in Blender. Now you can export Wavefront OBJ file.
Use OpenGLOBJLoader class to render your model in iPhone.
And one more thing: you should invert (subtract from 1) texture coordinates on y axis in order to get your texture rendered properly.
For example, if you have texture coordinates like this:
vt 0.800008 0.400000
vt 0.800008 0.150000
...
make sure that you have them inverted like this:
vt 0.800008 0.600000
vt 0.800008 0.850000
...